
Making Back-up 's with Access DB
Quote:
>You can use the FileCopy command to copy the MDB file to another directory
>or another name. The trick is you'll need to make sure that everyone
>(assuming this is a multiuser app) is out of the application, and that the
>backup process in the app itself first closes the database and kills any
>connections to the database (recordsets, etc) that may exist in that
>instance of the app. If the FileCopy fails, there is probably a stray
>connection to the DB still open somewhere in your app.
Joe,
You can also use the "failsafe" way and use either Jet Replication or
synchronize two access databases. Basically, construct another database, if
possible, empty (using the various "Jet Engine" objects for DAO or ADO), then
copy records from the original database to the backup database. This takes
more work in the long run, but reduces "cleanup" code (sometimes it's not
possible to "kick" everyone out of a database...for instance, a database
running on a web server). Additionally, you get the ability to create a
general "backup" system which you could use for both full- and
incremental-backups; and additionally full or selective archival.
Another good alternative to the FileCopy command (though it also requires all
users out--since it needs exclusive-access mode) is to "Compact" the database
to the backup file. This will have the side-effect of reducing wasted space
and can be done at normal "maintenance" times.
-Curtis Spendlove
-Solstice Software