Database rollback help?

  • Thread starter Thread starter brettc
  • Start date Start date
B

brettc

Guest
Hi,

I have a current open database located in C:/SAFC/SAFC.mdb. I have a backup directory in a user defined location. Inside the backup directory are versions of the database made each day - SAFC-20-10-04.mdb.

Now i also have a form with a listbox that lists the backup versions from the backup folder. When the user double clicks on a backup version in the list it copies the selected backup version back to the C:/SAFC folder.

The problem i have is with either overwriting the currently open SAFC.mdb with the selected backup. If i close down the SAFC.mdb first before i copy the backup version how would it then run the next line of code as it is closed?

There must be an easy way of swapping two files if one is currently open?

Cheers!
 
Sounds like you need to rethink how you are backing up the data or (more importantly) retrieving it.

If you are accessing the db through vb - there is a possibility of overwriting the mdb file - once all connections to it are closed. If you are in Access though things are trickier.

One possible solution...
You'd need a launcher app (mdb) which checks for a specific file before running the normal one. One retrieving from the archive, you'd copy the file into the same folder as the one you are working on, but under a specific name (say Rollback.mdb). The db you are running then closes, you rerun the launcher app which does a check for Rollback.mdb. If it finds it, the normal mdb is deleted and Rolback.mdb is renamed to the normal mdb; which is then executed.

Another possible solutiong
Import all the tables from the archived section into the normal dbs tables mdb. In theory possible via code... :)

Another option
Link to the archived mdb, and update all the normal mdbs data that matches on unique ids to all the data. For those that don't match either add them in or delete them (missing in normal and missing in archive respectively).


Vince
 

Users who are viewing this thread

Back
Top Bottom