Auto Backup BE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am trying to find a way to get my front end to automatically compact
repair and then back up the back end. I tryed using some code posted by
Brenda Reynolds i n the thread Code for backing up a database. But i could
not seem to get it to work. If anyone has any ideas for suggesstions for how
i could do this it would be great

thanks
mary
 
Hi Mary,
The back-end must not be "active" to make it work. What I did was to open a
new form that has no table or recordset attached and closed the main form.
Then went through the compact/repair and copy routine for the back-end. My
routine used the on-timer event to automatically do the process, then quit
the application. See if that helps.

SteveD
 
Would you be able to help me with the code i do not know how to do the copy
programmically
thank you
mary
 
I'm assuming that you already have the compact routine and now need to copy
the database to a different location. The comand is FileCopy

Example1 (where the path & file has been predefined in a string)
FileCopy strDBLocal, strDBSave

Example2 (showing full path and file name)
'FileCopy "c:\SpecialProgram\Special_Data.mdb",
"H:\backup\Special_Data.mdb"

Example3 (compact the database to a different location)
DBEngine.CompactDatabase strDBSaveFrom, strDBSaveTo

I have created a routine that creates a Date/Timestamp that I append to the
saved database name so I end up with a saved version each time.
Periodically, I delete the early versions.

Does this help you accomplish what your looking for?

SteveD
 
Back
Top