Automatically Backup a Database

P

Paul

Is it possible to enable access to create a backup of a database once
a week (eg every Monday at 7am) rather than having to remember to
manually do it.

Thanks
 
B

bcap

To backup an Access database you all you need to do is to copy the file to
somewhere safe (preferably at a time when no-one is using it), which you can
easily do using the Windows Task Scheduler (which makes this a Windows
question, not an Access question).
 
D

Douglas J. Steele

Just to be argumentative <g>, there is an Access aspect to the question.
It's important not to do the backup while the database is in use: if it is,
then the backup may not be consistent internally. That having been said, all
you need to do is have the scheduled task check whether the locking file
(.ldb file) exists. If it exists, assume the database is in use, and don't
perform the backup.
 
B

bcap

Nothing wrong with belt-and-braces <g>, but he can expect to be OK if he
does it at a time when no-one is at work i.e. it shouldn't really matter if
someone left it open from last night so long as there is no chance that
anyone is actually doing an update at the time the file is copied.

I would humbly suggest (well, not very humbly <g>) that a backup taken while
the file is open but not in use has to be better than *no* backup,
particularly in an environment where, if people can't remember to take a
backup, then presumably they will not check that it ran automatically!
 
D

Douglas J. Steele

Perhaps, but you'd hate to think that you have a good backup, only to find
that the one record you desperately require is unusable!

I'd recommend putting code into the application so that it shuts down during
the time period when the backup is expected to be done, so that there's no
chance of a problem.
 
B

bcap

Yes, good idea.

Douglas J. Steele said:
Perhaps, but you'd hate to think that you have a good backup, only to find
that the one record you desperately require is unusable!

I'd recommend putting code into the application so that it shuts down
during the time period when the backup is expected to be done, so that
there's no chance of a problem.
 
Top