我想使用密码保护访问进行连接。请告知在下面的代码中我可以在哪里传递密码的参数。
With Acon1
.Provider = "Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=" + ThisWorkbook.Sheets(1).Range("V24").Value
.Open
End With
With Rs1
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.ActiveConnection = Acon1
.Source = "Select * from Headcount where [Employee ID]=" & myvalue0l
.Open
End With发布于 2017-06-01 14:17:51
尝试:
With Acon1
.Provider = "Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=" + ThisWorkbook.Sheets(1).Range("V24").Value & _
";User ID=admin;Password=" 'Password
.Open
End Withhttps://stackoverflow.com/questions/44299189
复制相似问题