Backing up with a batch file

pat_nospam

Registered User.
Local time
Today, 23:12
Joined
Oct 14, 2003
Messages
151
Backing up with a batch file - foolproof?

I've got a wonderful batch file I put together that I run at night to backup the whole directory in which the database and it's associated files are stored.

However, my question is, for a restore, do I just copy that information back into the directory? Sometimes there is an .ldb file also copied (if everyone has not logged out) - is that backup useless, or ?

Just wanted to get some feedback on how safe of a solution my backup method is.
 
I afraid that backin up a db while it's open could be very dangerous. I would implement some code that runs at a specific time to log all users off and then run you batch to backup. Search for "log users off".
 
Perfect solution and easy code to implement - mucho gracias :)

Any quick ideas on how to time it to log everyone out/run at midnight?
I can use task scheduler for the batch file to run - but how to I set the logout code to run?
 
I'm having problems with the DAO portion of the code, where it initializes the connection in the top two lines. I'm also having compile errors with the set snp = line. Any suggestions as to why the errors are coming up.

I copied the frm_ExitNow and pasted it into my forms. I created an external database with the Settings table and linked to it, then copied the code from the Form_Timer and Form_Onload sections into my startup form in my database.

Thanks for all your help :)
 
I'll work on stripping the database, the lines of code it is having problems with are:

Dim db As DAO.Database
Dim snp As DAO.Recordset

Set snp = db.OpenRecordset("Settings", dbOpenSnapshot)

In both the Form_Load and Form_Timer sections
 
Autoeng,

Also - would it have anything to do with me using OfficeXP (2002) Service Pack 2?

Just thought I'd throw that out there.

Everything in the database has worked very fluidly, except for this code. But I noticed it was meant for 2000, would that be the problem?

Thanks again
 
Hi Pat:

Glad you got it working. As far as the MS solution you could use it and schedule a delete of the file at midnight which would then cause the db to shut down then you could schecule your backup. However, I think that the solution you have in place is better in that it will always be running on it's own and not dependant on the scheduler. Make sure to set your db to Compact on close so that you get as small as backup as possible.
 

Users who are viewing this thread

Back
Top Bottom