我们可以将'Microsoft.ACE.Oledb.12.0.dll'的引用添加到项目中吗 [英] Can we add Reference of 'Microsoft.ACE.Oledb.12.0.dll' to project

查看:344
本文介绍了我们可以将'Microsoft.ACE.Oledb.12.0.dll'的引用添加到项目中吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误消息"Microsoft.ACE.OLEDB.12.0"提供程序未在本地计算机上注册.在我的测试服务器上.所以我的问题是:

I am getting error "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." on my testing servers. So My Question is :

i)我可以添加对'Microsoft.ACE.Oledb.12.0.dll'"的引用以进行自我投影吗? ii)安全吗? iii)如何做到?

i) Can i add reference for "'Microsoft.ACE.Oledb.12.0.dll'" to project it self? ii) Is it safe? iii) How to do this?

由于本地计算机上安装了最新版本的Office,因此一切都可以在本地计算机上运行.一旦我将代码部署到测试服务器,就会遇到错误.由于某些原因,我可能无法在测试服务器上安装Office.那么是否有可能将所有需要的dll放入项目本身,并将其也部署到测试服务器?

Every thing is working on my local machine since i have latest version of office install in my machine. As soon as i am deploying my code to testing servers i am getting above error. I might not be able to install Office on testing servers (Due to some reason). So is it possible to put all require dll in project itself and deploy that to testing servers too ?

谢谢.

推荐答案

要使用"Microsoft.ACE.OLEDB.12",您需要安装"Microsoft Access数据库引擎2010可再发行组件"

In order to use "Microsoft.ACE.OLEDB.12" you need to install the "Microsoft Access Database Engine 2010 Redistributable"

有关此信息的页面在这里: http://www.microsoft.com/en-us/download /details.aspx?id=13255

The information page for this is here: http://www.microsoft.com/en-us/download/details.aspx?id=13255

@ user1297578正确地指出了实际的下载位置: http://www.microsoft.com/en-in/download /confirmation.aspx?id=13255

And as @user1297578 quite rightly noted the actual download is here: http://www.microsoft.com/en-in/download/confirmation.aspx?id=13255

安装后,实际的程序集称为ACEOLEDB.DLL,命令提示符处的以下命令将在您的系统上为您找到它:

Once you have installed that, the actual assembly is called ACEOLEDB.DLL, the following command at a Command Prompt will find it for you on your system:

C:\>DIR /s/b c:\ACEOLEDB.DLL
c:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL

作为参考,以下是在安装上述可再发行组件之前从程序收到的错误消息:

For reference, the following is the error message I received from a program until I installed the above redistributable:

Connection Failed. 
Error from IDataInitialize::GetDataSource
with connectionString=Data Source=C:\MyFileName.mdb;Mode=Share Deny Write;Provider=Microsoft.ACE.OLEDB.12.0;User Id=admin
OLE DB Error Report:
    ErrorRecord:
    Hresult=80040154
    Description: Class not registered
    SQLErrorInfo: No error info available
    Source: Microsoft OLE DB Service Components

这篇关于我们可以将'Microsoft.ACE.Oledb.12.0.dll'的引用添加到项目中吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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