Databases are fundamentally different from word processors
and spreadsheets. But, any file that is being accessed by
multiple users can be in an unknown state so a copy can't be
reliable. Even a single user Access/Jet application is
multithreaded so, internally, it too is multi user. Even
the Compact action closes the database before doing its job.
What all that means is that before I can try to make
suggestions on how to backup an open file, I would have to
know the details about your application. How it is
structured, single file or split into front end - back end?
If split, I presume it's the back end you want to back up?
How is the database used, a single user, ocassionally by a
few users, 24/7 by hundreds of users?
Regardless of the answers to those questions, the way you go
about it will not be as simple as using a FileCopy command.
The obvious trivial approach is to do it manually at a time
when you know that nobody is using the application, but even
that assumes that some human is a reliable part of the
process.
To do it with a button in the application, means that you
have to have code that ensures that the data file is closed
before using FileCopy. (Most likely you tried it and came
to the newsgroups because FileCopy flat out refuses to copy
an open file.)
If your database is not split, then you need to use another
program to do the backup. See Michael Kaplan's TSI SOON
utility at
http://www.trigeminal.com/ for a good way to
control that kind of operation.