|
3#
楼主 |
发表于 2009-12-6 14:20:23
|
只看该作者
Sub 导入()
Dim MyPath$, S$
Dim MyDb As Database
Dim Tbl As TableDef
On Error Resume Next
MyPath = CurrentProject.Path
Set MyDb = Application.DBEngine.OpenDatabase(MyPath & "\db2.mdb")
For Each Tbl In MyDb.TableDefs
S = Tbl.Name
If InStr(S, "MSys") = 0 Then
'怎么判断数据库中表是否存在?
DoCmd.DeleteObject acTable, S
DoCmd.TransferDatabase acImport, "Microsoft Access", MyPath & "\db2.mdb", acTable, S, S, False
End If
Next Tbl
Set MyDb = Nothing
End Sub |
|