Close database file and open another to backup first one

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Would like program to backup and compact database on exit. A second database
called by the main one automatically on exit, could do this job. How can I
call the second database from the first one as it closes ?
 
What exactly do you want to do?


It seems like you want to do this ...
Compact DATA.mdb just before closing CLIENT.mdb

That would only work if no one else is attached to DATA.mdb

Ok, so maybe I misunderstood and you want to do this ...
Compact UNRELATED.mdb just before closing CLIENT.mdb

If that's all you want to do, then all you need is this line of code ...
Application.CompactRepair SourceFile, DestinationFile

Or, maybe you wanted to do this ...
Compact CLIENTmdb just before closing CLIENT.mdb

Depending on which version you're using, you can set an option
to compact on close. (Not that I recommend that, but it works.)
 
Back
Top