运行时错误“3709”在VB6中访问SQL数据库时
我有一个某人编写的 VB6 应用程序,该应用程序仅适用于某些尝试使用它的用户。
这是运行时返回错误的代码:
On Error GOTO error_handler
..
Set db = New ADODB.Connection
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=****;Password=****; Initial Catalog=***;Data Source=****,1433"
error_handler:
If db.Error.count then
strDBErrors = "No access to Main Database."
For Each err In db.errors
strDBErrors = strDBErrors & vbCrLf & err.Description
Next
MsgBox strDBErrors
运行此代码后,我收到两个错误框。一个指出运行时错误 3709,另一个有两行:其中一行是我的自定义错误消息,第二行是:“用户用户登录失败”。
这种情况仅发生在安装了该程序的特定计算机上的一个用户身上。它不会在任何其他计算机上与任何其他用户发生。 我尝试在该计算机上使用该用户重新安装该程序,但没有成功。
有什么想法吗?
I have a VB6 application which someone wrote, which does not work for only some users who try to use it.
This is the code running which returns an error:
On Error GOTO error_handler
..
Set db = New ADODB.Connection
db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=****;Password=****; Initial Catalog=***;Data Source=****,1433"
error_handler:
If db.Error.count then
strDBErrors = "No access to Main Database."
For Each err In db.errors
strDBErrors = strDBErrors & vbCrLf & err.Description
Next
MsgBox strDBErrors
After this code runs, I get two Boxes of error. One which states a Runtime Error 3709, And the other which has Two lines: one of it is my Custom error message, and the second if this: "Logon Failed for user the user".
This only happens to one user on a specific computer on which this program is installed. It does not happen on any other computer with any other user.
I tried reinstalling the program with that user on that computer, but it did not work.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不太确定问题是什么,
但我只是删除了 Active Directory 上的用户并重新创建了它,它就成功了。
但该用户不是任何拒绝组的成员。
Not quite sure what the problem was,
but I just erased the user on Active Directory and created it again, and it worked.
The user wasn't a member of any deny groups though.