Below is a script I use in a .VBS file
Dim objScript, strSource, strTarget, strMsg, strDevFldr, strServFld
Dim sPrefix, sMonth, sDay, sYear, sHour, sMinuite
'If MsgBox("Backup files? ", 4+32,"Warning!") = 6 Then
' /////// NOTE: Edit variables in this section ///////
'
' The following lines of code are the only variable that need be edited
' You must provide a path to the folder where development files arekept
'
strDevFldr = "C:\Development\BDC\"
strServFld = "\\Pharmatech2003\Data\IT\Production\BDC\"
'
' /////// NOTE: Edit variables in this section ///////
' Get the file Prefix for archiv sake.
sMonth = DatePart("m",Date())
If Len(sMonth) = 1 Then sMonth = "0" & sMonth
sDay = DatePart("d",Date())
If Len(sDay) = 1 Then sDay = "0" & sDay
sYear = Right(DatePart("yyyy",Date()),2)
sHour= DatePart("h",Now())
If Len(sHour) = 1 Then sHour = "0" & sHour
sMinuite = DatePart("n",Now())
If Len(sMinuite) = 1 Then sMinuite = "0" & sMinuite
sPrefix = sMonth & "-" & sDay & "-" & sYear & " " & sHour & "_" & sMinuite & "_"
' Create Scripting Object
Set objScript = CreateObject("Scripting.FileSystemObject")
' ***************************************************************************
' Compact/Backup BDC to Server Dev Archive
strSource = strDevFldr & "BDC.adp"
strTarget = strServFld & "Dev_Copy\" & sPrefix & "BDC.adp"
'objScript.DeleteFile strTarget
objScript.CopyFile strSource ,strTarget
'
' ***************************************************************************
' ***************************************************************************
' Compact/Backup BDC to Local Staging
strSource = strDevFldr & "BDC.adp"
strTarget = strDevFldr & "Staging\BDC.adp"
objScript.DeleteFile strTarget
objScript.CopyFile strSource ,strTarget
'
' ***************************************************************************
' Clean up
Set objAccess = Nothing
' Finished
MsgBox "Finished compacting/backing up development databases."
'End If
--
Danny J. Lesandrini
(e-mail address removed)
- Show quoted text -