Question Ways to set up a compact and back-up schedule?

Margarita

Registered User.
Local time
Today, 01:40
Joined
Aug 12, 2011
Messages
185
Hello,
I am working in Access 2003 with a back end and front end split. I am looking for any suggestions for the best way to set up an automatic back end back up and compact schedule. I've read some posts about creating a copy of the folder where the back end file resides and pasting it to a back-up location. What I ideally want to do is have only one back-up folder, where I would replace the existing back-up file each time a back up is run, not paste another one. I would also like to compact before creating the back up copy. What is the most efficient way of automating this process? I am not looking foe anyone to write code for me- just general advice would be greatly appreciated.
Thanks in advance!
 
You can use one database to compact another so you could create a small database DB2 that on opening the autoexec macro runs some code that will compact the back-end of the database you want to compact DB1, at the same time it will compact it to a back-up version by specifying a different file name/folder DB1_backup etc.
This database DB1 could then be opened by a windows scheduled task which you can set to run at your convenience.
David
 
Sorry meant: This database DB2 could then be opened by a windows scheduled task
 
Sorry meant: This database DB2 could then be opened by a windows scheduled task

Thank you David! I think your suggestion of using schduled tasks is exactly what I was missing. I will certainly do more research on it. Thanks again!
 
A second database is not required. Databases can be compacted from a command run by the scheduler. Use the /compact switch in the command.

Basically it looks like this:

PathToAccess.exe PathToFile /compact
 
I would suggest that you BackUp before Compact and Repair.

Just in case the Compact goes wrong, which can happen.
 

Users who are viewing this thread

Back
Top Bottom