- Version
- Download 221
- File Size 390.48 KB
- File Count 1
- Create Date March 1, 2016
- Last Updated March 1, 2016
Backup MS Access Database in Visual Basic
Backup MS Access Database in Visual Basic
This is actually a process of copying the original file and save it in selected location or path in your computer.
A step by step tutorial and source code is included in the download file that will help you on how to create a backup copy of your ms access database in visual basic.
Sample code:
Private Sub cmdSave_Click()
Dim FS As New FileSystemObject
FS.CopyFile App.Path & "Data.mdb", txtBackupPath & "Data" & ".mdb", True
Set FS = Nothing
MsgBox "Backup successful", vbInformation, ""
End Sub
Private Sub Dir1_Click()
txtBackupPath = Dir1.Path
On Error GoTo errHandler:
Exit Sub
errHandler:
MsgBox " Error drive is not accessible", vbInformation, ""
Drive1.Drive = "C:"
End Sub
Private Sub Dir1_Change()
Dir1_Click
End Sub
Private Sub Drive1_Change()
On Error GoTo errHandler
Dir1.Path = Drive1.Drive
Exit Sub
errHandler:
MsgBox " Error drive is not accessible", vbInformation, ""
Drive1.Drive = "C:"
End Sub