ADODB.Connection.Open失败(MS Access VBA) [英] ADODB.Connection.Open fails (MS Access VBA)
问题描述
以下是代码:
cn.ConnectionString =" Provider = Microsoft.Jet.OLEDB.4.0;" &安培; _
"用户ID =管理员;" &安培; _
"数据来源= R:\ Recycle_be.mdb"
cn.Open
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"User ID=Admin;" & _
"Data Source=R:\Recycle_be.mdb"
cn.Open
R:是位于其上的单独位置的映射计算机网络。这是用户的机器。在他的机器上有一些需要检索和更新的信息。我以前使用过这段代码而且运行正常。但最近,他收到了一台新的XP机器。以前是Profressional 2000.
R: is a mapped computer located in a separate location on the network. It's a user's machine. On his machine is some information that needs to be retrieved and updated. I've used this code before and it worked fine. But recently, he received a new XP machine. Previous was Profressional 2000.
现在运行此代码并且用户已登录时,打开失败并显示以下消息:
Now when this code is run, and the user is logged in, the open fails with the following message:
运行 - 时间错误'-2147467259(80004005)'
Run-time error '-2147467259(80004005)'
无法使用" ;;正在使用的文件。
Could not use "; file in use.
当我链接到机器时,我无法通过双击访问.mdb。我必须通过Access来获取对机器的访问权。
When I link to the machine, I cannot access the .mdb by double clicking. I must go through Access to gain access to the machine.
为什么cn.open现在在以前没有出现时失败?
Why is cn.open failing now when it didn't before?
Al
PS:请不要问为什么数据不在中心位置。这是因为用户处于追踪者状态,他的系统需要很长时间才能更新记录。而且他是副总裁的兄弟,所以这就是为什么要做出来的。
PS: Please don't ask why the data is not centrally located. It's because the user is in a trailor and his system takes too long to updated records. And he is the VP's brother, so this is why hoops were made.
推荐答案
试试这个连接字符串。
Try this connection string.
Provider = Microsoft.Jet.OLEDB.4.0; Data Source = R:\ Recycle_be.mdb; Persist Security Info = False
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=R:\Recycle_be.mdb;Persist Security Info=False
这篇关于ADODB.Connection.Open失败(MS Access VBA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!