我如何知道我的程序是否需要 MDAC?
我有一组 Windows 程序,主要是用 VB6 和 VC++ 6 创建的。它的安装程序是使用 InstallShield 创建的。
一些用户最近报告了在 Vista 上安装它时遇到的问题。 它抱怨“MDAC 2.6 Sp2无法安装在这台机器上。MDAC 2.6 Sp2需要以下任何一种配置”,然后列出了几个操作系统,Vista不在其中。
谷歌搜索一下 显示 InstallShield 对 MDAC 的处理存在错误 - 它应该不要在 Vista 上检查它,因为 Vista 上没有 MDAC 这样的东西(有一个新东西 - “Windows DAC”)。
我可以对该页面上建议的 InstallShield 项目进行更改,但我对此感到担心,因为我无法测试它(此问题不会出现在所有 Vista 计算机上,而且我无法使它发生在我可以访问的任何 Vista 机器上)。
然而,在查看了 Wikipedia 关于 MDAC 的页面后,我无法想象为什么我们的程序首先需要它。 我们没有使用任何数据库,至少没有明确使用(不过,也许我们正在使用的某些 Microsoft 组件正在使用它?)。
我不是 InstallShield 项目的原始作者。 我开始怀疑 MDAC 可能是无意中添加到其中的,或者可能是无意中添加的,但就像“呃,也许我们需要它”。
如何明确判断我的程序是否需要 MDAC? 我可以看看VB6和VC++项目中的参考资料等; 有什么方法可以判断我是否可以安全地从 InstallShield 项目中删除 MDAC? 例如,也许有一个 MDAC 参考,如果我的 VB/VC++ 项目中没有该参考,则意味着我的程序肯定不需要 MDAC?
预先感谢您的任何帮助。
I have a set of Windows programs that is mostly created with VB6 and VC++ 6. Its installer is created using InstallShield.
A couple users have recently reported a problem trying to install it on Vista. It is complaining that "MDAC 2.6 Sp2 cannot be installed on this machine. MDAC 2.6 Sp2 requires any one of the following configurations", and then lists several OSes, Vista not among them.
A little googling shows that there's a bug in InstallShield's handling of MDAC - it shouldn't be checking for it on Vista, because there is no such thing as MDAC on Vista (there's a new thing - "Windows DAC").
I could make the change to my InstallShield project suggested on that page, but I am concerned about doing so, because I have no way to test it (this problem does not occur on all Vista machines, and I haven't been able to make it happen on any Vista machine I have access to).
However, after looking at Wikipedia's page on MDAC, I can't imagine why we would need it for our programs in the first place. We're not using any databases, at least not explictly (maybe some Microsoft component that we're using is using it, though?).
I was not the original author of the InstallShield project. I am beginning to suspect that MDAC might have been inadvertantly added to it, or perhaps advertantly but just as "uhhh, maybe we need that".
How can I explicitly tell whether my programs need MDAC or not? I can look at the references and such in the VB6 and VC++ projects; is there any way to tell from those whether I can safely remove MDAC from the InstallShield project? For example, perhaps there's a single MDAC reference which, if not present in my VB/VC++ projects, means that my programs definitely do not require MDAC?
Thanks in advance for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我希望您是对的,MDAC 可能包含在原始 InstallShield 项目配置中,并且没有人费心删除它。
在VB6方面,您应该能够通过进入“参考”对话框(我认为它在IDE的“项目”下拉菜单中)并检查其中是否有与MDAC有关的内容来判断是否正在使用MDAC或 MSAccess。 我有一段时间没有使用 VB6,但文本应该类似于“Microsoft ActiveX Data Objects 2.x Library”。
我猜它不太可能在 C++ 方面使用,但您可以尝试搜索 msdado、mdac 和 msaccess 等关键字,看看其中一个 mdac dll 上是否有 #import 的迹象。
I expect you are right, MDAC was probably included with the original InstallShield project configuration, and nobody has bothered to remove it.
On the VB6 side you should be able to tell if MDAC is being used by going into the "References" dialog (I think its in the Projects dropdown menu of the ide) and checking to see if there is anything in there to do with MDAC or MSAccess. I haven't worked with VB6 in a while, but the text should look something like "Microsoft ActiveX Data Objects 2.x Library".
I'm guessing it is less likely that it is being used On the C++ side, but you could try searching for keywords like msdado, mdac and msaccess to see if theres any sign of a #import on one of the mdac dlls.
当部署到 Windows XP 及更高版本时,没有理由包含 MDAC 或 Jet 4.0,因为即使是 XP RTM(黄金版)也附带了 MDAC 2.7 和 Jet 4.0。
Microsoft 数据访问组件 (MDAC) 发布历史记录
如何获取 Microsoft Jet 4.0 数据库引擎的最新服务包 详细介绍了 Jet 的最新历史。
MDAC 版本包括 ADO 的兼容性类型库,因此即使您的程序是针对 MDAC 2.6 编译的,它实际上也会在目标计算机上使用最新的 ADO。 如果程序过早与 ADOX 绑定,那么真正的悲伤就会到来。
ADOX 从未附带适当的兼容性接口,因此程序应该几乎总是使用 ADOX 的后期绑定。
DAO 是另一个问题,但是 (a.) 如果没有好的借口,任何人都不应该再使用它,并且 (b.) 它在 DAO 3.6 时就死掉了,所以只要你的程序升级到 3.6 和 Jet5x( Jet 4.0、Access 2000 格式)。
当然,当从 XP 进行下层部署时,情况会变得更加复杂。
When deploying to Windows XP and later there is no reason to include MDAC or Jet 4.0, since even XP RTM (gold) shipped with MDAC 2.7 as well as Jet 4.0.
Microsoft Data Access Components (MDAC) release history
How to obtain the latest service pack for the Microsoft Jet 4.0 Database Engine goes into more recent Jet history.
MDAC releases include compatibility typelibs for ADO, so even if your program was compiled against MDAC 2.6 it will actually use the latest ADO on a target machine. The real grief can come if the program early-binds to ADOX.
ADOX never shipped with appropriate compatibility interfaces, so programs should almost always use late binding with ADOX.
DAO is another issue, but (a.) nobody should really be using it anymore without a good excuse and (b.) it died at DAO 3.6 so there should be no compatibility issue as long as your programs were upgraded to 3.6 and Jet5x (Jet 4.0, Access 2000 format).
The story gets more complicated when deploying downlevel from XP of course.
我认为从 Windows XP 开始,微软就开始包含 MDAC。 但是,在 MDAC 2.6 版及更高版本中,它们不再包含 Jet 4.0 组件。 (Jet 4.0 SP8 可以是位于此处)
如果您使用的是 Visual Fox Pro,则需要安装 ODBC 或 OLEDB 驱动程序,具体取决于您的代码。
ODBC
OLEDB
全部这些下载取决于是否至少安装了 MDAC 2.6。
Beginning I think with Windows XP Microsoft began including MDAC. However, in MDAC version 2.6 and later they no longer included the Jet 4.0 components. (Jet 4.0 SP8 can be found here)
If you are using Visual Fox Pro you need to install either the ODBC or OLEDB drivers depending on you code for that.
ODBC
OLEDB
All of these downloads depend on having at least MDAC 2.6 installed.