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

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

问题描述

由于我在Windows 7中安装了一台新的开发机,所以在VB6上编译一些旧版应用程序时遇到了一些问题(我的旧版本是在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

我比较了两台计算机和项目-引用相同:( Microsoft ActiveX数据对象2.7库

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

什么可能导致此错误?

推荐答案

这是已知的 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.

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

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