Wednesday, September 22, 2010

VB 6.0 Create Backup of a Table

mdbpassword = "9990513523"
file2 = "account.mdb"
cn3.Open "Provider=MSDataShape.1;Data Provider = Microsoft.Jet.OLEDB.3.51;Jet OLEDB:Database Password=" & mdbpassword & ";data source=" & file2
c = InputBox("Enter Table Name to Save::::Use only Numbers and Alphabets..", "Save Table")
If c = "" Then
cn3.Close
Exit Sub
Else
cn3.Execute "select * into [" & c & "] from attendance"
cn3.Execute "delete values from attendance"
cn3.Close
MsgBox "Table " & c & " Saved", vbInformation, "Saving Information..."
Att.Refresh
End If

No comments: