Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Backup

Status
Not open for further replies.

mpm32

Technical User
Feb 19, 2004
130
US
I have a database where I created a button that runs a bunch of sendobjects of all the important tables to a back-up database.

The problem with this is that it requires the users to remember to push the button. I could have it run on database close but with 8+ users this would be time consuming.

I am trying to come up with a way where it will run after the last user closes the DB. With no set time where they may close the database, I am having trouble figuring out how to determine who the last user is.

I suppose I could set it to run at a certain time each night, but that would require a PC running all the time.

Any suggestions?
 
Use the Windows scheduler to copy the entire MDB file to an alternative location.

John
 
So, in trying to write a batch file I tried;

Code:
copy C:\test G:

This works fine.
But if I try to specify a file like this;

Code:
copy C:\test\specificfile.xls G:

It doesn't work

I tried xcode too but I couldn't get it to copy just one file. I don't have much experiance writing batch files and couldn't find the syntax to specifiy just one file.
 
Well, I got this to work for a test;

Code:
copy c:\test\test1\"For Marie.xls" G:

But when I try it on the file that I want to copy;

Code:
copy G:\D-SHL1-RECOVERY\Legal\New Litigation Database\"Litigation Database.mdb" C:\Mel\Bankruptcy\Lit Database Design\Backup

It does not copy.

 
copy "G:\D-SHL1-RECOVERY\Legal\New Litigation Database\Litigation Database.mdb" "C:\Mel\Bankruptcy\Lit Database Design\Backup"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Try
Code:
copy "G:\D-SHL1-RECOVERY\Legal\New Litigation Database\Litigation Database.mdb" "C:\Mel\Bankruptcy\Lit Database Design\Backup"
 
Thanks, the one thing I didn't try were the quotes around each string. That worked.
 
How would I tag a date stamp onto each copy? In other words, if I run this every day, I don't want to overwrite the previous days copy. I would like to append the sysdate to the file name.

Thanks for all of your help.
 
How about:

Code:
copy "G:\D-SHL1-RECOVERY\Legal\New Litigation Database\Litigation Database.mdb" "C:\Mel\Bankruptcy\Lit Database Design\Backup\" & Format(Date,"yyyymmdd") & ".mdb"
 
Hmmm, It just copies and overwrites the previous copy.
 
Do you wish to include time as well?

This:

"C:\Mel\Bankruptcy\Lit Database Design\Backup\" & Format(Date,"yyyymmdd") & ".mdb"

Is:
C:\Mel\Bankruptcy\Lit Database Design\Backup\20070919.mdb

So you should get a new copy each day.
 
I tried that but something must be missing because it doesn't rename the file, it just copies it with the original name.
 
Suggest you take a look at Total Access Agent from FMS
This was the best $299.00 I ever spent to schedule Access tasks (macros and compact and repairs). Yes, you can schedule backups of the DB's and keep a number of them archived and compressed.
 
Hi MPM32,

Going back to you original post....
Copy you code from your original comand button to a new form on the BE.
Set that form as the Startup form
On timer event run you code and then close Accces.
Get the windows schedule to run the BE at the same time every day on one PC. You will not be able to compact and repair at this time but your backup code should still be OK.

Garry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top