代码如下:
Dim dbs As DAO.Database '要添加DAO引用
Dim stDocName As String
Dim wtb As DAO.TableDef
Set dbs = CurrentDb
For Each wtb In dbs.TableDefs
If Nz(InStr(1, wtb.Name, "sys", vbTextCompare)) = 0 Then
dbs.TableDefs.Delete wtb.Name
End If
Next wtb
dbs.Close
'如下语句你自已回去完善一下吧,读出数据库s1所有表名即可
DoCmd.TransferDatabase acLink, "Microsoft Access", "I:\CONTACT\CONTACT.MDB", acTable, "Switchboard Items", "Switchboard Items", False