Backup for MS Access

04-14-2004, 09:33 AM

i want to take backup of the database (MS Access 2000). What i m planning is to provide open and save dialog boxes for selection and save( for destination address) purpose.

I m known to use of RTB for text files to open, edit and save but i could not do for .MDB file.

I have searched through the forum but could not find proper links...

I want to know what i m suppose to write to get a copy of database at the specified location.
Bellow is just simple code for Open and Save dialogbox. Pl guide me to complete my task.....

Private Sub Command1_Click()
With cd1
.DialogTitle = "Open"
.InitDir = "D:\"
.Filter = "Access Files (*.mdb)|*.mdb|All Files (*.*)|*.*"
End With

Text1.Text = cd1.FileName

End Sub

Private Sub Command2_Click()
With cd1
.DialogTitle = "Save"
.InitDir = "D:\"
.Filter = "Access Files (*.mdb)|*.mdb|All Files (*.*)|*.*"
.FileName = Text1.Text
End With
' here what i need to write....????
End Sub


04-14-2004, 10:15 AM
You need to copy the file. Text1 will hold the path to the Source file - not the file itself, and you need a Text2 for the path to the Destination file. Then, simply use the built-in FileCopy function:

FileCopy Text1.Text, Text2.Text

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum