Dim db As Database
Dim tbl As TableDef
Dim a As String
Dim B As String
Dim D As String
a = "sa" '用户
B = "102030" '口令
Set db = CurrentDb
For Each tbl In db.TableDefs
If Left(tbl.Connect, 4) = "ODBC" Then
tbl.C
tbl.Attributes = dbAttachSavePWD
tbl.RefreshLink
End If
Next