如果我在编译的win7,与和QUOT ADODB.Connection错误VB6的应用程序;类不支持自动化或不支持预期的接口"

如果我在编译的win7,与和QUOT ADODB.Connection错误VB6的应用程序;类不支持自动化或不支持预期的接口"

问题描述:

我整理了一些VB6 code在我的X64 Win7的机器,结果.exe文件将不会在任何其他机器正常运行。

I compiled some VB6 code on my Win7 x64 machine and the result .exe will not run correctly on any other machine.

VB6 code是只用一个按钮一个新的模板.exe文件,引用Microsoft ActiveX数据对象2.6库和下面的code在按钮preSS事件:

VB6 code is just a new template .exe file with one button, a reference to "Microsoft ActiveX Data Objects 2.6 Library" and the following code in the button press event:

Dim db
Set db = New ADODB.Connection

它运行正常我的机器上,但没有人(甚至其他Win7的X64服务器)(更新:我发现了两个其他用户运行的地方,其中一人是杰夫·阿特伍德!但大部分机器有同样的问题)

It runs correctly on my machine, but no others (even other Win7 x64 machines) (Update: I found TWO other users where it runs and one of them is Jeff Atwood!, but most machines have the same problem)

我查了引用屏幕在两台机器上,看是否有参考失败(它不会编译,则尽管它编译罚款)。一切看起来合法的。在64位机器,引用进入SysWow64文件,而不是SYSTEM32。

I checked the references screen on both machines to see if a reference failed (it wouldn't compile then though and it compiles fine). Everything looks legit. On the 64 bit machines, the references go into SysWow64 instead of system32.

我甚至编译这个成功的一个Vista的64位计算机上,把它正常运行。这只是在Windows 7中编译,然后在那里的错误发生任何其他机器上运行。

I've even compiled this successfully on a Vista 64 bit machine and had it run correctly. It's only the compile on the Windows 7 and then running on any other machine where the error happens.

下面是我的机器上运行CompChecker的结果:

Here are the results of running CompChecker on my box:

注册信息:ADODB.Connection具有GUID HKEY_CLASSES_ROOT \ CLSID {}​​ 00000514-0000-0010-8000-00AA006D2EA4

Registry info: ADODB.Connection has GUID HKEY_CLASSES_ROOT\CLSID{00000514-0000-0010-8000-00AA006D2EA4}

InprocServer32的是%COMMONPROGRAMFILES%\系统\ ADO \ MSADO15.DLL

InprocServer32 is %CommonProgramFiles%\System\ado\msado15.dll

这是一个Windows 7 SP1的问题。请参见 http://support.microsoft.com/kb/2517589 获取解决方法。

This is a Windows 7 SP1 issue. See http://support.microsoft.com/kb/2517589 for workarounds.

有其他的方法解决此问题:

There are other ways around this:

  1. 使用ADO 2.8,而不是(从Win 7的RTM 磁盘)
  2. 使用后期绑定(可能是 最简单的)
  3. 有一百万的东西, 人们试图在这个很长的 而愤怒的主题:重大更改的MDAC ADODB COM组件在Windows 7 Service Pack 1的
  1. Use ADO 2.8 instead (from Win 7 RTM disk)
  2. Use late-binding (probably the easiest)
  3. There are a million things that people are trying on this very long and angry thread: Breaking change in MDAC ADODB COM components in Windows 7 Service Pack 1

另外,还有一点,MSADO15.DLL不支持64位的Win 7如下所列: HTTP:/ /support.microsoft.com/kb/983246 。这是一个很大的页面,只需搜索 MSADO15.DLL

Also, another thing, msado15.dll is not supported on x64 Win 7 as listed here: http://support.microsoft.com/kb/983246. It's a big page, just search on msado15.dll.