连接代码如下:
Dim db As Database
Dim tbl As TableDef
Set db = CurrentDb
For Each tbl In db.TableDefs
If tbl.Attributes = 536870912 Then
'打开数据库密码为8888888
tbl.C
tbl.RefreshLink
' '打开数据库密码为空
' tbl.C
' tbl.RefreshLink
End If
Next
连接代码如下:
Dim db As Database
Dim tbl As TableDef
Set db = CurrentDb
For Each tbl In db.TableDefs
If tbl.Attributes = 536870912 Then
'打开数据库密码为8888888
tbl.Connect = "DSN=JJMDB;UID=saWD=888888;WSID=;DATABASE=sys;Network=DBMSSOCN"
tbl.RefreshLink
' '打开数据库密码为空
' tbl.Connect = "DSN=JJMDB;UID=saWD=;WSID=;DATABASE=sys;Network=DBMSSOCN"
' tbl.RefreshLink
End If
Next