Microsoft Access 12.0对象库 [英] Microsoft Access 12.0 Object Library

查看:105
本文介绍了Microsoft Access 12.0对象库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Microsoft Access 12.0对象库.
我转到项目/添加引用/COM"选项卡,然后选择"Microsoft Access 12.0对象库",然后单击确定".现在,尽我所能,我无法访问库中的任何对象. Microsoft Excel 12.0对象库也是如此.但是,如果我尝试使用Microsoft Excel 5.0对象库,它将起作用.我究竟做错了什么?我不应该做的是什么?
请帮忙!

肯:mad:

I am trying to use the Microsoft Access 12.0 Object library.
I go to Project/Add Reference/COM Tab and select Microsoft Access 12.0 Object Library then Ok. Now try as hard as I can, I can''t access any of the objects in the library. The same goes for Microsoft Excel 12.0 Object library. Yet however, if I try Microsoft Excel 5.0 Object library it works. What am I doing wrong? What am I not doing that I should be doing?
Please help!!

Ken. :mad:

推荐答案

听起来您没有在计算机上安装Excel 2007/Access 2007(因为Excel 5.0对象库正在工作,所以您确实有已安装的Excel版本).您需要将对象库用于已安装的Office版本(或以前的版本,因为大多数Office对象库都向后兼容)

如果确实安装了Excel 2007/Access 2007,则可能必须安装Office主互操作程序集(请参阅
It sound like you don''t have Excel 2007/Access 2007 installed on your machine (since the Excel 5.0 object library is working you do have a version of Excel installed). You need to use an object library for the version of Office you have installed (or for a previous version, since most Office object libraries are backwards compatibe)

If you do have Excel 2007/Access 2007 installed then you might have to install the Office Primary Interop Assemblies (see this MSDN howto[^])


感谢格雷厄姆的帮助.
我已经安装了所有内容的Office Pro2007.
为了安全起见,我下载了Office Primary Interop程序集并重新安装了它们.顺便说一句,要安装它,您必须将"o2007PIA.msi"重命名为"PIAredist.msi"(感谢当时浪费了Microsoft:〜).
我仍然不能让它做我想做的事.也许我对这两段代码之间的区别感到困惑:

Thanks Graham for your assistance.
I have Office Pro 2007 with everything installed.
Just to be safe, I downloaded the Office Primary Interop Assemblies and reinstalled them. By the way, to get it to install you have to rename "o2007PIA.msi" to "PIAredist.msi" (Thanks for that time waster Microsoft :~).
I still can''t get it to do what I want. Maybe I''m confused about the difference between these two pieces of code:

Dim objAccess As Object
Set objAccess = CreateObject("Access.Application")


可以正常工作.....


which works and .....

Dim oAccess As Access.Application
' Start a new instance of Access for Automation:
oAccess = New Access.ApplicationClass()



哪个没有.

因此,我将继续第一种方法.

干杯.



Which doesn''t.

So I''ll just carry on with the the first method.

Cheers.


这篇关于Microsoft Access 12.0对象库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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