Use vba from a form to make a backup of the current database?

H

havocdragon

Hey all, I have a very critical button that runs some sensitive code
(sensitive on the data anyways), what I want to do, is when the button is
pushed, make a backup of that database (exact copy, pre-button pushing), into
a backup folder...

Is there anyway to do this?
 
A

Allen Browne

There is no reliable way I know of to back up an Access database that is in
use.

You can loop through all the tables to export the data, but it may be an
inconsistent copy (if changes occured during the copy process), or perhaps
some tables may have be locked (so the copy would lack those tables.)

If you accept those risks and want to do it anyway, see:
http://allenbrowne.com/Unlinked/Backup.txt
 
E

e.mel.net

havocdragon said:
Hey all, I have a very critical button that runs some sensitive code
(sensitive on the data anyways), what I want to do, is when the button is
pushed, make a backup of that database (exact copy, pre-button pushing), into
a backup folder...

Is there anyway to do this?


try:
DoCmd.CopyDatabaseFile(DatabaseFileName, OverwriteExistingFile,
DisconnectAllUsers)

its in Access 2002 , I dont know about older
 
Top