The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

Posted on 2011-10-25
Last Modified: 2012-11-22
I am working on my local machine. I setup a web application in vs 2010 and read an excel spreadsheet via oledb like so:

 var sConnectionString = "Provider =Microsoft.ACE.OLEDB.12.0;" +
"Data Source=" + HttpContext.Current.Server.MapPath("Return Addresses.xlsx") + ";" +
"Extended Properties =\"Excel 12.0 Xml;HDR=YES;\"";

        // Create connection object by using the preceding connection string.
        var objConn = new OleDbConnection(sConnectionString);

        // Open connection with the database.

It worked flawlessly. I setup a website (not application) in vs2010 running on localhost. I run the exact same code and get the following error when i run objConn.Open();:

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

Im using the same machine, I have office 2010 32-bit version installed (my machine is a 64-bit). I have downloaded and ran AccessDatabaseEngine.exe downloaded from this site, but that didnt work either. Why can I  read an excel spreadsheet via oledb when I create a web application, but cant read it when I create a website?

Question by:troycomp
    1 Comment
    LVL 17

    Accepted Solution

    Hello, you can try these two options:
    1. Try installing the 64bit version of Microsoft Access Database Engine components, here the link (is different from yours):

    2. If you are running your web site on your local IIS, probably your application pool where your aspnet application is running don't has enabled the option to allow 32bit applications, you can set that in your application pool advanced settings (IIS7), enabling it will allow to use the 32bit Microsoft.ACE.OLEDB.12.0 provider:
    Application Pool Advanced Settings - IIS7
    I recommend you to try the option 1 first.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now