by Esmael Telmosa (7 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Fri 16th June 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Procedure to back-up database (for MS Access)
API Declarations
Dim CommondialogControl As Control
'CommondialogControl = CommondialogControl
'Ask the filename of Back-Up
CommondialogControl.Filter = "Back-Up Files (*.mdb)|*.mdb"
'Set Default DIR
CommondialogControl.InitDir = "C:\"
'Display the SHOWSAVE window
CommondialogControl.ShowSave
On Error GoTo Opps
'If there is an entry
If CommondialogControl.FileName <> "" Then
'if already exist then delete the file
If Dir(CommondialogControl.FileName) <> "" Then Kill CommondialogControl.FileName
' 'repair database
'' DBEngine.RepairDatabase "C:\Documents and Settings\allen\Desktop\mitch-barcode\monitoringdbCon.mdb"
FileCopy StrSource, CommondialogControl.FileName
'Text1.Text = CommondialogControl.FileName
'Prompt to User that Back_Up is Completed
MsgBox "Back-Up Complete!", vbInformation, "BACK-UP SUCCESSFUL"
End If
Exit Sub
Opps:
MsgBox Err.Description, vbExclamation, "Employee Status System"
End Sub