Backup

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

Upon closing my database i want to give the user a option to backup a
database. Does anybody have an example of how to accomplish this?

If possible a hard-coded path so the only thing a user has to do is click
yes for a backup would be nice.


Regards,
Harmannus
 
It is not possible for a running Access database to produce a workable copy
of itself, without some ugly & unnecessary workarounds.

The best approach, IMO, is to split the database into a so-called "front
end/back end" structure. With that structure, you have a BE database
containing all of the tables but nothing else, and a FE database containing
all of the queries, forms, reports, macros, and modules, and links to the
actual table in the BE.

Then, the FE database can close the BE database & produce a copy of it, with
the normal VBA FileCopy statement.

So, if you haven't done this already, I suggest you focus initially on how
to split your database into a FE/BE structure. There is a bit of work in
understanding this & doing it properly, but that work will pay off for all
your other database projects. There are many advantages to a FE/BE structure
in addition to the one that I have noted above.

HTH,
TC
 
But, if you're reading this, understand that using FileCopy to copy the
currently running database is not ok. It >will produce< a copy, but that
copy will not necessarily work correctly when you try to open it later! The
only safe time to use FileCopy to copy an Access database, is when the
database being copied is >closed< - not open.

HTH,
TC
 
Back
Top