Automating Backup of Database

G

Guest

I want to be able to have a button on my database front end that will
automate the backing of my database. I have tried to assign a macro to my
button that will run the backup command. However upon clicking the button I
get the following message: The Command or Action 'Backup' isn't available now.

Is there a way to assign the backup procedure to a button on a form or on a
toolbar ?

Thanks inadvance for any help.

Neil.
 
R

Ron2006

The macro backup command and the backupcommand off of the menu, backsup
the mdb that you are in (your front end) not the linked tables, (the
BE).

Whatever routine you end up deriving to use, you in essence must copy
the BE mdb file to someplace else to back it up.

The potential problem is if you are copying it, it could be in the
middle of an update process from another user, and your resulting copy,
may have problems and some corrupt data.

It is the BE that has to be copied and saved to another name in order
to backup your data.
 
G

Guest

Ron,

I can't use the backup command off the menu because I have hidden it and
replaced it with my own menu bar. If I put the backup command on my menu bar
it does not display because I have hidden the main database window from the
user. Hence my problem with automating the backup. Any other suggestions.
Thanks.

Neil.
 
R

Ron2006

What I am saying is that even if you could could put it there, it is
going to back up the FE and NOT the data.

Therefore that is not what you want.

You want to create a macro that executes code that COPIES the BE mdb.

That can be done in your module somewhere.

OR with a batch file that is executed exclusive of Access that does it.

Or in another mdb that is executed periodically that does the copy.

BUT

if not all users are out of the tables (or one is in the middle of an
update) there is the potential for corruption. of a record.
 
G

Guest

Here is some code to copy the backend of your database. Remember what Neil
said:
"The potential problem is if you are copying it, it could be in the
middle of an update process from another user, and your resulting copy,
may have problems and some corrupt data. "

fso.copyfile "full file name of sorce db", _
"full destination name of target location"

You could put this behind a command button or in the On Exit event of your
main form.
 
G

Guest

Thanks Ron & Eric

Eric Blitzer said:
Here is some code to copy the backend of your database. Remember what Neil
said:
"The potential problem is if you are copying it, it could be in the
middle of an update process from another user, and your resulting copy,
may have problems and some corrupt data. "

fso.copyfile "full file name of sorce db", _
"full destination name of target location"

You could put this behind a command button or in the On Exit event of your
main form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top