Supposing that everyone has gone home, you could use the windows task scheduler for this. You need to ensure that the database is not in use at the time. Peter Meachem
peter@accuflight.com
Ok, maybe that would work. But how do I start the automatic backup? I´ve found a vbscript that makes a copy of the db and name it after the day and time the copy is made. But I do not know how to run it automatic.
The script looks like this:
Script To Create Backup Copy of Access database
' *****************************************************
' Script To Create Backup Copy of RC3.mdb *
' *
' Danny J. Lesandrini August 28, 2000 *
' dan@dea.com or datafast@home.com *
' Dean Evans & Associates, Inc *
'
*
' *
' *
' This script was created to simplify the process *
' of backing up a development copy of an MS Access *
' database. *
' *
' The same process can be used in reverse to copy *
' a development master file to the user's desktop *
' for editing. The file is renamed with a prefix *
' created from the current Date and Time, thus *
' making it unique (assuming you don't execute the *
' script more frequently than once per minute). *
' *
' *****************************************************
Dim strRootPath
Dim strFileName
Dim objScript
Dim strPrefix
Dim strMonth
Dim strDay
Dim strYear
Dim strHour
Dim strMinuite
Dim strSource
Dim strTarget
Dim strMsg
' **** The following 2 lines of code are the only variables that need be edited
' **** Enter your path and the name of the file you wish to backup.
' ****
' **** NOTE: It is assumed that a folder named "Archive" exists under the above-
' **** named Root Path. If that folder does not exist, then create it later.
'
strRootPath = "C:\Test\"
strFileName = "RC3.mdb"
' **** To provide a unique prefix for the backup file, the current date and time
' **** is parsed and concatonated into a string variable
'
strMonth = DatePart("m",Date())
If Len(strMonth) = 1 Then strMonth = "0" & strMonth
strDay = DatePart("d",Date())
If Len(strDay) = 1 Then strDay = "0" & strDay
' **** Create the Scripting Object and copy the file
' **** (First, we verify that the Archive Folder exists and, if
' **** absent, it is created.)
'
Set objScript= CreateObject("Scripting.FileSystemObject"
If Not objScript.FolderExists(strRootPath & "Archive\" Then
objScript.CreateFolder(strRootPath & "Archive\"
End If
objScript.CopyFile strSource, strTarget
' **** Clean up
'
Set objScript= Nothing
' **** Inform User that Operation is Completed
'
strMsg = "The following file:" & vbCrLf & Space(5) & strPrefix & strFileName & vbCrLf & vbCrLf & "has been created in the Archive folder."
MsgBox strMsg,,"Finished"
That looks remarkably complicated. Start the task scheduler, and look up help. You can run any dos batch file and just do a copy, remember dos commands.
Your script may well work, try it and see. Peter Meachem
peter@accuflight.com
HI!
I just wrote it, it works incredible nice!
Thanks a lot, just wonder, maybe I can use some parts of the vbscript to name the backup file after the day it was taken. Any solution in Dos for that?
i was just playing with your code... that is exacly what i've been looking for for about a month... i made some modifications to make it fit my needs... but here's a thought for you... use this code in the on close of a form that stays open for all the users... then when ever a user closes the database, it'll run the code... and since it includes the time and date, you'll have multiple copies for each day that it's used... and if it's not used, you don't need to make a backup
(like a weekend or some thing)
just an idea...
--Junior JHauge@jmjpc.net
Life is change. To deny change is to deny life.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.