VS 2012.3 引用 MS Access COM DLL,无法解决 COM 引用错误 [英] VS 2012.3 Referencing MS Access COM DLL, could not resolve COM reference error

查看:22
本文介绍了VS 2012.3 引用 MS Access COM DLL,无法解决 COM 引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS2012.3(32 位 exe)中创建了一个新的控制台项目,并添加了对 Microsoft Access 的 COM 类型库引用(我尝试了 2003 和 2007).Microsoft Access"引用显示在添加引用"对话框中没有问题.但是,在关闭该对话框后,VS 会在两个新添加的引用上显示一个黄色三角形叠加层,并且出现以下构建错误:

I created a new Console project in VS2012.3 (32bit exe) and added a COM Type Library reference to Microsoft Access (I tried both 2003 and 2007). The "Microsoft Access" reference shows up in the Add Reference dialog no problem. However, upon closing that dialog VS displays a yellow triangle overlay on the two newly added references, and I get the following build error:

无法解析 COM 引用4affc9a0-5f99-101b-af4e-00aa003f0f07"9.0 版.对象引用未设置为对象的实例.

Could not resolve COM reference "4affc9a0-5f99-101b-af4e-00aa003f0f07" version 9.0. Object reference not set to an instance of an object.

我的同事可以在他们的计算机上毫无问题地执行此操作.所以我想弄清楚我的机器可能有什么问题.我运行的是 Windows 8.1,而其他人运行的是 Windows 8.0 和 7 的混合版本.有什么想法吗?

My colleagues are able to do this with no problem on their computer. So I'm trying to figure out what could be the problem with my machine. I'm running Windows 8.1, whereas others are running a mix of Windows 8.0 and 7. Any ideas?

更新 - 一些屏幕截图:

推荐答案

问题已解决:我在这里找到了解决方案:http://support.microsoft.com/kb/823996.
我所要做的就是打开VS2012 的开发人员命令提示符",向下导航到 GAC 的 ADODB 文件夹,然后运行 ​​regasm.exe ADODB.dll.这解决了整个问题.

Problem Solved: I found the solution here: http://support.microsoft.com/kb/823996.
All I had to do was open the "Developer Command Prompt for VS2012", navigate down to the GAC's ADODB folder, then run regasm.exe ADODB.dll. That fixed the entire problem.

问题已解决:

这篇关于VS 2012.3 引用 MS Access COM DLL,无法解决 COM 引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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