Back Up Database

  • Thread starter Thread starter Jone
  • Start date Start date
J

Jone

Hi ! HAPPY NEW YEAR!!!,

What code do I write when I want the back up database option to come up
 
"not working" doesn't really give us much to go by.

Do you get an error message? If so, what's the error? If you don't get an
error message, what happens when you run the code? For that matter, how are
you running the code? (i.e.: are you certainly that it's running?)
 
Hi Doug

I've been playing with this and now I'm not sure that this is possible,
because the first thing the backup routine attempts is a compact. Since you
can't compact a database with a running macro or code, the runcommand is
just not going to do it. Makes you wonder why MS included it at all.

(the reason I posted it was just that I remembered seeing it in the acCmd
list)
 
You could be right.

I've never tried using the command. Since all of my databases are split, and
since I can't see any reason to backup the front-end, I've never needed to
worry about it. It's a simple matter to use FileCopy to make a backup of the
back-end when there's no open connections to it.
 
How do I use FileCopy

Douglas J. Steele said:
You could be right.

I've never tried using the command. Since all of my databases are split, and
since I can't see any reason to backup the front-end, I've never needed to
worry about it. It's a simple matter to use FileCopy to make a backup of the
back-end when there's no open connections to it.
 
FileCopy source, destination

For example, to take a file C:\Folder\File.mdb and create a copy that has
the current date in the file name (C:\Folder\File2008-01-03.mdb), you'd use

FileCopy "C:\Folder\File.mdb", "C:\Folder\File" & Format(Date(),
"yyyy-mm-dd") & ".mdb"
 
Back
Top