Run a batch File

JBurlison

Registered User.
Local time
Yesterday, 21:41
Joined
Mar 14, 2008
Messages
172
How do i run a batch from VBA? i want to put the code in my on load event of my opening form. the batch file backs up the database
 
Use the shell() function?

shell("c:\myBatchFile.bat")

???
 
How do i run a batch from VBA? i want to put the code in my on load event of my opening form. the batch file backs up the database

Ken's got it for you, but I think you might not realize that if you back it up while the database is open (which has to be since you are running this from a form) you run the risk of it not backing up properly. It may work and it may fail, because copying an mdb file while someone is in it can cause corruption in the copied file.

Just wanted you to be aware of the risk.
 
humm so what would be the best way of baking up schedule it on the server?
 
You can do it from a batch file on your computer, or server, and kicked off with scheduler.
 

Users who are viewing this thread

Back
Top Bottom