|
Subject:
|
Automate Backup of backend database
|
|
Posted By:
|
medix_911
|
Post Date:
|
8/30/2006 9:12:04 PM
|
Hello Folks,
I'm trying to figure out a way through VBA and the ontimer event to send a copy of the backend database to a jump drive every so many minutes. This is in a database that i wrote for the auction industry and the data changes every 30 to 45 seconds. If the network or laptop that holds the backend database crashes i need a quick and viable backup to pull. I'm currently using a batch file but would much rather do it with VBA. Any and all help would be greatly appreciated.
I should probably elaborate a little on this project. I have a form within the database that holds default company information to be used throughout the program. Like the path to he artwork for header reports and the likes. This information is used to set properties of forms and reports from the onopen event. I have 2 fields in the form, 1 for BUFile (The file to be backed up) and BULocation (The location to back the file up to) I have tried 7 ways to sunday to automate this through VBA code and have failed so far. If anyone needs more information, don't hesitate to contact me. I have also subscribed to this topic so i will be notified via e-mail when you post and will get back to you as quick as i can.
|
|
Reply By:
|
medix_911
|
Reply Date:
|
8/31/2006 8:16:25 AM
|
Nevermind folks. I figured it out. For anyone else that would like to automate a back up though. Here is the code i used. You can either put it on a cmd button or i have it set under the ontimer event to fire every 5 minutes.
Dim SourceFile, DestinationFile
SourceFile = Forms.frmcompanyinformation.BUFile.value DestinationFile = Forms.frmcompanyinformation.BULocation.value
FileCopy SourceFile, DestinationFile
It's a nice little snipet of code because it allows the user to set which file to back up and where to back it up too by setting file paths in the default company screen.
|