How can I backup my database using an Event procedure?

G

Guest

I'm trying to backup my database by clicking a command button. I think a
DoMenuItem command might work, but I don't know the specific code (ie.
"DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70").

Any suggestions?
 
M

Marshall Barton

Curious said:
I'm trying to backup my database by clicking a command button. I think a
DoMenuItem command might work, but I don't know the specific code (ie.
"DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70").


You can not reliably copy an open database file because you
can not guarantee that it is in a quiescent state. Since
the database that contains the code you are asking for is
running, the file must obviously be open.

Don't forget that a backup should be verified before it is
put on the shelf. Without at least a quick check that the
backup file is comple, you won't know if it can be restore
until you are desperate for it to work.

Putting all that together implies pretty strongly that a
backup is an offline operation, not something that can be
done by a simple button click in your application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top