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

Well I wanted to set up what I thought would be a simple Excel file import into my ProxyChecker, so I used previous code to upload the file to the web server and create a OLEDB connection to it.

My Excel 8  (Excel 2003) connection string was:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
 + ServerFullPath
 + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\""); 

And my Excel 12 (Excel 2007) connection string was;

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
 + ServerFullPath
 + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\""; 

But when I went to run, both XLS and XLSX connections would fail with either:

The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

or

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

I sourced the problem to the fact that the connection strings I was trying to use 32-bit drivers, but I was on a 64-bit Sharepoint installation. After a bit of research I found that it doesn’t appear there were ever any 64-bit Office 2007 drivers, but luckily there are some for 2010, and they appeared to be backward compatible.

So after downloading them from here I went to install them only to be faced with an error saying they couldn’t be installed because I had pre-installed 32-bit office applications. Luckily it told me what they were (as I would have not remembered) – you may have guessed – it was Sharepoint Designer 2007.

After the uninstall the AccessDatabaseEngine_X64.exe installation went with out a hitch. So I change my XLSX connection string to Microsoft.ACE.OLEDB.12.0 and BOOM – new error;

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

Best laid plans of mice and men….

I checked the driver version in ODBC and yep – definitely version 14. Then by complete luck I can across a mention that the version number hadnt been changed in the connection string (sounds like an omission to me) – so I put it back to Microsoft.ACE.OLEDB.12.0 – and ZOOM – everything works.

So there you go. If you are trying to create a connection to an XLSX (Excel 2007) spreadsheet, ensure you have no 32-bit Office apps on the server, install AccessDatabaseEngine_X64.exe  and set your connection string to;

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
 + ServerFullPath
 + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";

The good news is that this driver also works for XLS (Excel 2003) by simply changing the Excel version reference;

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
 + ServerFullPath
 + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";

Update

The link for the Microsoft Access Database Engine 2010 Redistributable has been a bit flaky the past couple of weeks so if you are having trouble getting hold of it you can download it from my site using the link below.

Please note you should always attempt to download from the official links, I provide this cached copy purely to assist those having difficulty downloading it and am not responsible for any errors or loss caused by its usage
Related:

22 Comments


  1. peter
    Dec 02, 2010

    thank you for this, you have saved me a lot of time


  2. Monex
    Dec 28, 2010

    …..Provider Microsoft.Jet.OLEDB.4.0 Data Source c directory Extended …..Properties dBASE IV User ID Admin Password …………..Excel…….. ….Driver Microsoft Excel Driver ….. .xls DriverId 790 Dbq C MyExcel.xls DefaultDir c directory …. ….Provider Microsoft.Jet.OLEDB.4.0 Data Source C MyExcel.xls Extended Properties Excel 8.0 HDR Yes IMEX 1 ……………Exchange……..


  3. Rani
    Jan 13, 2011

    Thanks


  4. aaron
    Jan 13, 2011

    No problems, hope it helped.


  5. golden
    Feb 26, 2011

    Hi i have same problem
    i have 32 bit office 2007 installed
    64bit os vista
    installed access database engine 2007
    access database engine 64 wont install
    so what do i do
    i even change the build target x86
    and i cant uninstall office cause its only one i have
    i tried everything i just cant get around this

    Your help will be greatly appreciated,
    Golden


  6. Geetha
    Mar 28, 2011

    Hi Aaron,

    I followed all the instructions and was able to fix the issue. But i cleared my windows temp folder and the issue has re-appeared. I run a repair on Microsoft Access Database Engine 2010 Redistributable and Office but didnt help. Please please help me.. This is a bit urgent.

    Thanks,
    Geetha


  7. João Piçarra
    Apr 05, 2011

    Did you already got that 64bits nasty bug that keeps a transaction that never finishes and rollback won’t do anything?


  8. Alex
    Apr 05, 2011

    Many thanks, this helped me.


  9. sandy
    Apr 27, 2011

    After uploading the program to the server it is giving me the below error :
    ” An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine ”

    I found out that the issue is with the code related to reading excel.xslx file data to the webpage.

    Can you please tell me where the issue can be


  10. Ram
    May 18, 2011

    Helped me a lot…… :)


  11. Pat
    Jun 16, 2011

    hey that helped me out. The other instructions I found on web to enable 32 bit apps in iis7 did not work for me, bu this did. thanks again. Pat.


  12. Bruno Oliveira
    Aug 23, 2011

    Hi,

    I have 2 question :P
    1) Can I install la version 32bit from de Driver and compile the application in x86?
    2) I have the Office 2003 installed (32 bit), if I need to uninstaller to install the Driver 64 bit, but can I reinstall the Office 2003 after?

    Thank you.


  13. Sonny
    Oct 21, 2011

    Thank you!!!!!


  14. vikram
    Nov 15, 2011

    You r great Guy boss thanks a ton for the Help :)


  15. Ted
    Dec 06, 2011

    I’ve tried the same things but still get the problem, I’m running a MVC 3 app, The Provider=Microsoft.ACE.OLEDB.12.0;Data Source=filename;Extended Properties=Excel 12.0 xml;HDR=Yes,IMEX=1

    This worked on a regular aspx page


  16. thang
    Dec 13, 2011

    Hi Golden,
    You can install access database engine 64 with command: AccessDatabaseEngine_X64.exe /passive


  17. Bernie
    Jul 09, 2012

    It is working fine for me, my problem is when i give it to client it gives the error provider not registered. help please


  18. aaron
    Jul 10, 2012

    Bernie, if you have gone through the above steps and it has worked for your development machine (ie the machine you developed and tested the code on) then it suggest that the target server (the server your client is attempting to run your code on) needs to go through the same steps – ie uninstall everything 32bit then install 64bit.

    Of course you will need to assist the client in understanding what 32bit software they have installed on the target machine as if it is in use alternative procedures will need to be put it place.


  19. Krishna
    Jul 13, 2012

    This worked for me. This is the code that i used.
    My environment: micosoft excel 2010.

    Fixes:
    Downloaded MDAC 2010 for 32-bit machine. (Not sure if this needed) but it worked for me.
    .Net 2008. under build make “Platform Target” as x86.

    Code:
    @”Provider=Microsoft.ACE.OLEDB.12.0; ” +
    @”Data Source=” + _strExcelFilename + “;” +
    @”Extended Properties=” + Convert.ToChar(34).ToString() +
    @”Excel 8.0;”+ ExcelConnectionOptions() + Convert.ToChar(34).ToString();


  20. verinska
    Apr 02, 2013

    thanks.. your the best..

  21. [...] Can installation of Microsoft Access Database Engine 2010 Redistributable change the situation? Maybe I should install another version/something else? Source: http://www.arboundy.com/2010/11/the-microsoft.ace.oledb.12.0-provider-is-not-registered-on-the-local... [...]

Leave a Reply




 

Latest Videos