更新时间:2022-11-27 21:04:00
***的解决方案显然是使用Windows安全性.
The best solution is obviously to use Windows security.
如果不合适,这是一个可能的替代技巧,它利用Access会记住所有打开的连接直到程序关闭的事实:
If that is not suitable, here is a possible alternative trick, exploiting the fact that Access remembers all opened connections until the program is closed:
SELECT 1
PWD=something;
.DCount("*", "ptqConnect")
这样的东西.SELECT 1
PWD=something;
in it.DCount("*", "ptqConnect")
will do.就是这样.由于Access在关闭前会记住打开的连接,因此即使关闭数据库,即使链接表的连接字符串中未存储密码,其他表也将立即打开,而不必担心. 如果您不想公开包含PWD的连接字符串,则***通过VBA发起连接并通过提供MDE或仅通过密码保护代码来隐藏代码.
That's it. Since Access remembers opened connections until you close it, even if you close the db, your other tables will now open without any fuss, even if no password is stored in the linked tables Connect string.
If you don't want to expose the connection string that includes the PWD, you could as well initiate a connection from VBA and hide the code by delivering a MDE or just password protecting the code.
您可以找到有关此行为的说明此处.
You can find an explanation of this behaviour here.