VB6 App 重新编译后将无法在 Server 2008 上运行
我正在尝试移动网络服务器。我们的应用程序(说实话)是在 1998 年(我认为)用 VB6 编写的。我已经在我们的新服务器(Windows Server 2008 R2 64 位)上运行了。但是,当我在我的计算机(Windows 7 64 位)上获取源代码并将 exe 传输到服务器时,应用程序在尝试连接到数据库时崩溃并出现以下错误:“错误 430(类不支持自动化或不支持预期的接口)”
该项目引用了 Microsoft Activex Data Objects 2.8 库。错误的行是
Set conn = New adodb.Connection
So, 它实际上并不是在尝试连接到数据库,而是在尝试创建对象时纯粹崩溃了。
有人对这种错误有任何经验吗?或者对我有什么建议吗?谷歌有几种可能性,但都没有成功。其中大多数与通用控件和使用“项目兼容性”有关 - 但我的应用程序以“无人值守执行”运行,所以我无法选择它(它在项目属性中完全禁用)。
I'm trying to move web servers. Our app (be kind) was written back in 1998 (I think) in VB6. I've got it working on our new server (Windows Server 2008 R2 64 bit). However, when I take the source code on my machine (Windows 7 64 Bit), and transfer the exe to the server, the app blows up when it tries to connect to the database with this error: "Error 430 (Class does not support Automation or does not support expected interface)"
The project references Microsoft Activex Data Objects 2.8 Library. The line that errors is
Set conn = New adodb.Connection
So, it's not actually trying to connect to the database, but purely blowing up when trying to create the object.
Anyone have any experience with this kind of error? Or any suggestions for me? Google had several possibilities but none of them panned out. Most of them had to do with Common Controls and using "Project Compatibility" -- but my app runs with "Unattended Execution" and so I can't choose that (it's completely disabled in the project properties.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Microsoft 在 SP1 中引入的对 MDAC 的重大更改。查看此MSDN 论坛主题。它提供了一些解决方法的建议。截至目前,微软还没有修复该问题。
我在 32 位 Windows 7 上遇到了这个问题,最终回滚了 SP1。
建议之一是将更新的(损坏的)mdac dll 替换为未提供服务的打包计算机中的 mdac dll:
打开 Regedit 并找到键
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\TypeLib\{2A75196C-D9EB -4129-B803-931327F72D5C}
右键单击,权限,高级,所有者,将所有者更改为管理员,单击确定,确定
运行
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12 -u "%CommonProgramFiles(x86)%\system\ado\msado28.tlb"
将
msado28.tlb
从 Win7 RTM/Win2008R2 RTM 复制到本地计算机,记下该文件夹下一步。运行
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12“{path}\msado28.tlb”
这些步骤适用于 64 位 Windows。对于 32 位应该是相同的,但需要调整路径。
It's a breaking change to MDAC that Microsoft introduced in SP1. Check out this MSDN Forum Thread. It has a few suggestions for work-arounds. As of yet, there is no fix from Microsoft.
I ran into this on 32-bit Windows 7 and ended up rolling back SP1.
One of the suggestions is to replace the updated (broken) mdac dll with one from an un-service packed machine:
Open Regedit and locate the key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\TypeLib\{2A75196C-D9EB-4129-B803-931327F72D5C}
Right click, Permissions, Advanced, Owner, Change owner to Administrators, Click OK, OK
Run
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12 -u "%CommonProgramFiles(x86)%\system\ado\msado28.tlb"
Copy
msado28.tlb
from Win7 RTM/Win2008R2 RTM to your local machine, note the folder for the next step.Run
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12 "{path}\msado28.tlb"
These steps are for 64-bit windows. Should be the same for 32-bit with adjustment for the paths.