how do we create an automatic backup of a database

Correct, PDFs don't compress much.

Although; my tool exports/emails 6 PDFs per sales rep, and they prefer to receive a single file.

I also use this code to Backup one of my other DBs, as you have stated.
 
the code works, great, i looks like it shouldn't work or we shouldn't do this but it works.
 
I think I've posted this sometime in the past but it might be useful again here. This is a simple routine that is fired on closing the database, when it creates a dated backup folder and copies itself there. I also set the database to Compact on Close in Tools > Options, which only works when the last user closes out of the database. The routine has some limitations:
  1. It only stores one backup a day. If the database is closed more than once, earlier backups that day are overwritten. You can add more sections if necessary, using time functions, such as Hour(Now()).
  2. You could create one folder per day with a longer name instead of a tree or simply rename the database by adding a date/time stamp to the filename. The code is (hopefully) adequately commented.
  3. There is no retrospective cleaning up; backups are simply created and never deleted. There is therefore an onus on the administrator to archive or delete old backups. I zip completed years and archive them onto CD/DVD.
  4. The Compact on Close runs after the backup routine, so the backed-up database is not compacted. As this is set to happen every time the database is closed, it should never be that bad but it does mean that Access takes a little longer to close.
I'm open to questions; my email address is in the code or you can PM me here. This is offered as a solution that I figured out for myself and that works for me; no guarantees attached or implied!
 

Attachments

I think I've posted this sometime in the past but it might be useful again here. This is a simple routine that is fired on closing the database, when it creates a dated backup folder and copies itself there. I also set the database to Compact on Close in Tools > Options, which only works when the last user closes out of the database. The routine has some limitations:
  1. It only stores one backup a day. If the database is closed more than once, earlier backups that day are overwritten. You can add more sections if necessary, using time functions, such as Hour(Now()).
  2. You could create one folder per day with a longer name instead of a tree or simply rename the database by adding a date/time stamp to the filename. The code is (hopefully) adequately commented.
  3. There is no retrospective cleaning up; backups are simply created and never deleted. There is therefore an onus on the administrator to archive or delete old backups. I zip completed years and archive them onto CD/DVD.
  4. The Compact on Close runs after the backup routine, so the backed-up database is not compacted. As this is set to happen every time the database is closed, it should never be that bad but it does mean that Access takes a little longer to close.
I'm open to questions; my email address is in the code or you can PM me here. This is offered as a solution that I figured out for myself and that works for me; no guarantees attached or implied!

I know this is old but..

Is this code something that is run from a button on a from inside the db?
 

Users who are viewing this thread

Back
Top Bottom