-
1
- #1
These are a couple of routines to backup databases from one location to any other location in a Winzip format (I have multiple databases to backup each morning prior to importing new data):
'********************************************
Public Function My_Zip()
Dim stAppName As String
'First path (C:\My.zip)is the destination
'Second path (S:\ALL\Rick\*.md*) zips all databases, workgroup files, etc from the source folder
stAppName = "C:\Program Files\WinZip\WINZIP32.EXE -a -es C:\My.zip S:\ALL\Rick\*.md*"
Call Shell(stAppName, 1)
End Function
'*********end code*************
'This is attached to the On Open event of the startup form in the database
Public Function Archive_Zips()
Dim intButSelected As Integer, intButType As Integer
Dim strMsgPrompt As String, strMsgTitle As String
strMsgPrompt = "Run backup routines?"
strMsgTitle = "DB MANAGER"
intButType = vbYesNo + vbQuestion + vbDefaultButton1
intButSelected = MsgBox(strMsgPrompt, intButType, strMsgTitle)
If intButSelected = vbYes Then
Call My_Zip
DoEvents
'Example for additional archives
'Call CC_Zip
'DoEvents
'Call DailyReports_Zip
'DoEvents
'Call CR_Zip
'DoEvents
'Call STATUS_ZIP
'DoEvents
Else
GoTo 20
End If
20 DoCmd.Quit
End Function
'*********end code*************
Create a new database, place these in a module, create a startup form, and attach Archive_Zips() to the On Open event of the startup form
Hope this is of some use
'********************************************
Public Function My_Zip()
Dim stAppName As String
'First path (C:\My.zip)is the destination
'Second path (S:\ALL\Rick\*.md*) zips all databases, workgroup files, etc from the source folder
stAppName = "C:\Program Files\WinZip\WINZIP32.EXE -a -es C:\My.zip S:\ALL\Rick\*.md*"
Call Shell(stAppName, 1)
End Function
'*********end code*************
'This is attached to the On Open event of the startup form in the database
Public Function Archive_Zips()
Dim intButSelected As Integer, intButType As Integer
Dim strMsgPrompt As String, strMsgTitle As String
strMsgPrompt = "Run backup routines?"
strMsgTitle = "DB MANAGER"
intButType = vbYesNo + vbQuestion + vbDefaultButton1
intButSelected = MsgBox(strMsgPrompt, intButType, strMsgTitle)
If intButSelected = vbYes Then
Call My_Zip
DoEvents
'Example for additional archives
'Call CC_Zip
'DoEvents
'Call DailyReports_Zip
'DoEvents
'Call CR_Zip
'DoEvents
'Call STATUS_ZIP
'DoEvents
Else
GoTo 20
End If
20 DoCmd.Quit
End Function
'*********end code*************
Create a new database, place these in a module, create a startup form, and attach Archive_Zips() to the On Open event of the startup form
Hope this is of some use