Can we add Reference of 'Microsoft.ACE.Oledb.12.0.dll' to project
Asked Answered
A

3

7

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) Can i add reference for "'Microsoft.ACE.Oledb.12.0.dll'" to project it self? ii) Is it safe? iii) How to do this?

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 ?

Thanks in advance.

Arbil answered 22/8, 2013 at 12:26 Comment(1)
I know it has been a while since you asked this question, but I am facing same issue and I need to know if there's a way to add this dll to the asp web app. Thanks for any help.Bridges
B
1

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

The information page for this is here: http://www.microsoft.com/en-us/download/details.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

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
Boatwright answered 30/3, 2014 at 10:54 Comment(1)
If someone reply how to use this library only with *.DLL in the project, that would be awesome.Liberate
A
1

You can get around your problem by adding Microsoft Access Database Engine 2010 as prerequisites in Setup project, The following link shows you how to do so, but be careful, if you use VS2017 then the path is different, the path for VS2017 is:

"C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages"

not

"C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages"

Also I noticed that in some cases you have to install "AccessDatabaseEngine.exe" not "AccessDatabaseEngine_X64.exe" on user's machine, even if it is a 64-bit windows!!!

Here is the article including a video showing how to do all this in a step by step:

https://csharp-tutorials1.blogspot.com/2017/12/add-microsoft-access-engine-2010-as.html

Best regards

Aeschines answered 15/8, 2019 at 16:11 Comment(0)
I
-1

If you want use AccessDatabaseEngine 64 and IIS 64 bit (example windows 2012 64bit), then follow

  1. You must add role asp.net 4.0, .net 4.0 on IIS

  2. Open IIS Manager

  3. Open your site's application pool's advenced setting

  4. Enable 32-bit Applications set to False (must do this, or not iis set to 32 bit engine)

  5. if your site use .net 4.0, then .NET Framework version set to exactly version

6. [this is keypoint!!!] Managed Pipeline Mode set to "Classic"

good luck :)

Indispensable answered 18/2, 2014 at 5:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.