none
Backup DB question for Ken Sheridan RRS feed

  • Question

  • Hello Ken,

    I downloaded the backup DB sample I found in an earlier post you from another user. The DB is great and exactly what I am looking for. I am having trouble with one thing though. The way I understand it to work is whenever you close the DB it will create a backup copy of the back end but that doesn't seem to be happening. I was able to get everything loaded into my DB and set everything up properly so I can manually create a backup but it doesn't seems to work when I close the DB. Is it supposed to auto save whenever its closed or did I misread that? If so, then could you explain in greater detail what and where I am supposed to insert code into which form and so on. Right now the code is on the form you made in the "On Close" event but does nothing. Thanks for any help!

    Tuesday, December 26, 2017 4:46 PM

All replies

  • Hello Rplohocky,

    I would suggest you provide the previous post thread address where you download the db, so Ken Sheridan would know which backup db you are using.

    Besides, you could also show us the related code so we  could also try to reproduce your issue and try to help on it.

    Besides Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, December 27, 2017 5:30 AM
  • The way I understand it to work is whenever you close the DB it will create a backup copy of the back end but that doesn't seem to be happening.

    No that is not how it's intended to work.  It is set up solely to allow simple manual back-ups 'on demand' by the user via the  frmBackUp dialogue form. The code in the opening form's Close event procedure merely makes the navigation pane visible.

    For an automated back-up on closure, the interface would be very different.  Firstly there would be the need to set the location for the back-up, and store this as, for instance, a custom property of the current database.

    It would also be necessary to control the closure of the database, e.g. by forcing this via a command button.  Code in the button's click event procedure would then call the BackUp function, passing in the path to the back end (which is easy to return with some simple code), and the path to the back-up (stored in the custom property).  For multiple dated back-ups the code would add the current date to the name of the back-up file as in the cmdDatedBackUp_Click event procedure in the dialogue form's module.

    The code would then only call the Quit method of the DoCmd object if the BackEnd function returns True, or, in the event of the function returning False, e.g. if another user is currently backing up the back end, if the user elects to abort the back-up and close the file.


    Ken Sheridan, Stafford, England

    Wednesday, December 27, 2017 7:02 PM
  • I've now added an optional  'back-up on exit' routine to the BackupDemo file in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    the first time it's used you'll be prompted to browse to the paths to the front end and back end files.

    Ken Sheridan, Stafford, England

    Thursday, December 28, 2017 6:32 PM
  • Hi Rplohocky,

    Has the suggestion from Ken resolved your issue?

    If it has, I would suggest you mark the suggestion as answer to close this thread.

    Regards,

    Tony


    Help each other

    Wednesday, January 3, 2018 7:03 AM