“无效的过程调用或参数"“新 ADODB.Connection"上的错误;仅在 Windows 7 上编译 [英] "Invalid procedure call or argument" error on "New ADODB.Connection" only if compiled on Windows 7

查看:25
本文介绍了“无效的过程调用或参数"“新 ADODB.Connection"上的错误;仅在 Windows 7 上编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VB6 上编译一些遗留应用程序时遇到了一些问题,因为我在 Windows 7 中获得了一台新的开发机器.(我的旧机器是在 Windows XP 上.)

I'm experiencing some problem when I compile some legacy apps on VB6 since I got a new development machine in windows 7. (my old one was on Windows XP.)

如果我在我的 XP 机器上编译项目,一切都很好.如果我在我的 Windows 7 机器上编译相同的项目,它仍然可以正常运行,但如果我尝试在 XP 机器上运行它,我会收到此错误.

If I compile the project on my XP machine, everything is fine. If I compile the same project on my Windows 7 machine, it still run fine one it, but if I try to run it on a XP machine, I got this error.

错误编号:5
说明:无效的过程调用或参数

Error Number : 5
Description : Invalid procedure call or argument

感谢我的错误处理程序,我知道引发此错误的行是:

Thanks to my error handler, I know that the line that throw this error is :

    Dim objConn As ADODB.Connection
--> Set objConn = New ADODB.Connection

我比较了两台机器上的引用,Project - References 是相同的:(Microsoft ActiveX Data Objects 2.7 Library)

I compared the references on both machines and the Project - References are the same : (Microsoft ActiveX Data Objects 2.7 Library)

什么可能导致这个错误?

What could cause this error?

推荐答案

这是一个已知的 Microsoft 问题,但我不认为这是一个错误;我相信出于安全原因,兼容性被破坏了.如果您有 某些修补程序,则问题可能存在于非 SP1 版本中 已安装.Microsoft KB 中引用了几个选项.这是另一个 文章提供更新.

This is a known Microsoft issue, but I don't think it was a bug; I believe compatibility was broken for security reasons. The problem could have existed on a non-SP1 builds if you had a certain hotfix installed. There are a couple of options referenced in the Microsoft KB. Here is another article providing an update.

我们遇到了这个问题,我们决定在所有开发人员机器上部署向后兼容性补丁,并用向后兼容性参考替换所有旧 ADO 参考.这对我们来说效果很好.

We ran into this problem and we decided to deploy the Backwards Compatibility patch on all developer machines and replace all legacy ADO references with the Backwards Compatibility reference. This has worked well for us.

这篇关于“无效的过程调用或参数"“新 ADODB.Connection"上的错误;仅在 Windows 7 上编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆