|
Private Sub Command1_Click()
On Error Resume Next
Dim CAT As New ADOX.Catalog
Dim TBL As ADOX.Table
If MsgBox("程序将备份到 D:\学校backup.mdb 下,如果原有文件将会覆盖,请注意!", vbExclamation + vbYesNo, "备份提示:") = vbNo Then
GoTo m
End If
If Dir("d:\学校backup.mdb") = "" Then
CAT.Create "rovider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\学校backup.mdb"
End If
Set CAT.ActiveConnection = Me.Application.CurrentProject.Connection
For Each TBL In CAT.Tables
If Left(TBL.name, 4) <> "MSys" Then
If TBL.Type = "table" Then
DoCmd.TransferDatabase acExport, "Microsoft Access", "d:\学校backup.mdb", _
acTable, TBL.name, TBL.name
End If
End If
m:
Next
End Sub
我试验时,总提示
*用户定义类型未定义*
As New ADOX.Catalog
而在原程序中却可以用???
|
|