Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup Multiple Databases 1

Status
Not open for further replies.

Rick39

Programmer
May 11, 2001
426
US
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top