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

  • Question

  • Hello Experts.  I am stuck on something that should (probably) be pretty easy.  I downloaded and ran the samples from here:

    http://www.codeproject.com/Articles/37055/Working-with-MS-Excel-xls-xlsx-Using-MDAC-and-Oled

     

    All samples give me an error similar to this:

     

     

    I did some research on this.  I guess it has to do with me running this on a 64-bit machine, and Excel is 32-bit.  I think. . .

     

    I have Windows 7, Office 2010, and VS 2010.  Can someone please point me in the right direction so I can get this working.

     

    Thanks so much!!

    Sunday, February 5, 2012 9:41 PM

Answers

All replies

  • I think  jet.Oledb.4.0 doesnt work for 64Bit machine.

    You can use Microsoft.ACE.OLEDB.12.0 for 64 bit system. You can check is it 32 bit or 64 bit system. If 32 bit then use .JET.OLEDB else use ACE.OLEDB.

    You can check following link for downloading AccessDatabaseEngine

    http://www.microsoft.com/download/en/details.aspx?id=13255

    Hope it will help you.


    Hasibul Haque,MCC,MCPD hasibulhaque.com
    • Proposed as answer by Murugan A Monday, February 6, 2012 7:05 AM
    • Marked as answer by Lie YouModerator Friday, February 10, 2012 1:26 AM
    Monday, February 6, 2012 4:11 AM
  • Monday, February 6, 2012 6:16 AM
  • just right click on the project -> properties -> build -> change from target any cpu to target x86 -> f5 and it will work

    Peter Koueik

    • Proposed as answer by ShanDaRuban Thursday, April 19, 2012 6:41 PM
    Tuesday, April 17, 2012 8:58 AM
  • just right click on the project -> properties -> build -> change from target any cpu to target x86 -> f5 and it will work

    Peter Koueik

    Peter is absolutely correct. Thanks Peter for an answer. Keep it up.
    Tuesday, April 17, 2012 10:59 AM
  • just right click on the project -> properties -> build -> change from target any cpu to target x86 -> f5 and it will work

    Peter Koueik

    thanks it's work for me also.. but my case is different using C# thanks anyway... ;-)
    Thursday, April 19, 2012 6:43 PM
  • I'm already compiling against x86, I still have this problem.
    Thursday, May 24, 2012 5:57 PM
  • I'm already compiling against x86, I still have this problem.

    Run one of the engine installers at the link provided above.  I think that advice to change to x86 only works if you have a version of Office for x86 that is running in XP mode under Windows 7, or some other similarly exact scenario.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    Thursday, May 24, 2012 6:30 PM
    Moderator
  • Note that this is not a viable approach if 32 bit Office components are installed on the machine.

    Microsoft MVP / ALM Ranger

    Wednesday, June 6, 2012 2:25 AM
  • Note that this is not a viable approach if 32 bit Office components are installed on the machine.

    Microsoft MVP / ALM Ranger

    Why wouldn't it be? 

    The original problem seems to be a permissions issue associated with the assemblies loaded and installed with an Office installation.  It seems that the assemblies are installed only for use by Office.  It is simpler to install new copies that are available for all programs than it is to change the security and permissions on the originally installed Office assemblies. 

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    Wednesday, June 6, 2012 12:41 PM
    Moderator
  • First, Emprical evidence [I tried to install]. This is considered part of Office x64. You can NOT have Office x64 and Office x32 components on the same machine. You specifcaly get an error message doing the install that it is a 64 bit component, and 32 bit components must be removed.

    Microsoft MVP / ALM Ranger

    Wednesday, June 6, 2012 12:50 PM
  • That's an odd message.  Shouldn't the x86 and x64 components install to different locations?  What OS are you using?  Windows 7 has no problem with installing both x86 and x64 components.  I've installed both versions from the above link, no problem.  They seemed to know where to go all by themselves.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    Wednesday, June 6, 2012 2:04 PM
    Moderator
  • Window 7 64 bit [I did also try XP 64 bit, dont have a Vista 64 bit up and running].

    Straight from TechNet:  32bit and 64bit Office are NOT supported side-by-side: http://technet.microsoft.com/en-us/library/ee681792.aspx

    You can install both the 32 and 64 bit ADO, but there is a blocking check if 32 bit office (all components) is installed when trying to install a 64 bit component (such as the OleDbProvider).

    I also confirmed this with one of my "blue badge" contacts.


    Microsoft MVP / ALM Ranger

    Wednesday, June 6, 2012 2:56 PM
  • I would agree with that.  You cannot install x86 and x64 versions of Office side by side, but that is not what those links do. 

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    • Proposed as answer by Megh Vidani Thursday, July 26, 2012 3:11 AM
    • Unproposed as answer by Megh Vidani Thursday, July 26, 2012 3:11 AM
    Wednesday, June 6, 2012 7:08 PM
    Moderator
  • Thank you peter!
    Friday, July 27, 2012 11:22 AM
  • You are welcome... =)

    Peter Koueik

    Saturday, July 28, 2012 6:10 AM
  • Thank you Hasib, This became the solution to my problem. Since my MS-Office was 32 bit on the 64 bit Win7 OS, I had to install AccessDatabaseEngine.exe (32 bit).
    Monday, October 1, 2012 9:18 AM
  • Even I am receiving the error "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine"

    Following the above steps doesn't fix my problem. I have Office2013 Preview Installed & VS2010 on my machine. I did download the AccessDatabaseEngine_x64.exe and changed the build type to x64 but still having the same issue. 

    Can anyone help me resolve it. I need to read lot of excel file and put load the data into the activespaces ? Any suggestions how to fix it ?

     

    Monday, October 29, 2012 9:14 PM
  • Hello Soni Vashisht,

    Even I am receiving the error "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine"

    Following the above steps doesn't fix my problem. I have Office2013 Preview Installed & VS2010 on my machine. I did download the AccessDatabaseEngine_x64.exe and changed the build type to x64 but still having the same issue. 

    Can anyone help me resolve it. I need to read lot of excel file and put load the data into the activespaces ? Any suggestions how to fix it ? 

    with Office 2013 and can not know if it is still in preview, try to build the solution x86.
    Another thing, since this is a thread with replies opening a new thread

    Regards.


    Monday, October 29, 2012 9:25 PM
  • Thanks, I tried with x86 also still running into same issue. 
    Monday, October 29, 2012 10:01 PM
  • Btw, my machine is 64-bit OS so why I need to build in x86 , didn't understand why to build in x86?
    Monday, October 29, 2012 10:05 PM
  • What if you dont want to downgrade to x86 and want to use 64? how would you solve that?
    Monday, November 26, 2012 7:26 PM
  • What if you dont want to downgrade to x86 and want to use 64? how would you solve that?

    Monday, November 26, 2012 7:26 PM
  • just right click on the project -> properties -> build -> change from target any cpu to target x86 -> f5 and it will work

    Peter Koueik


    Perfect. Thank You
    • Proposed as answer by rthodupunuri Thursday, December 20, 2012 8:16 PM
    Thursday, December 20, 2012 8:16 PM
  • Browse to the application pool and select the Advance settings on your webs application. Set 'Enable 32-bit Applications' to TRUE. Worked for me.
    Tuesday, January 8, 2013 11:52 PM
  • Deleted
    Thursday, January 10, 2013 10:26 PM
  • Right Click on your project file not on the solution file...click properties

    you will have a vertical menu...
    within the menu there is a build section








    Peter Koueik

    Friday, January 11, 2013 6:25 AM
  • Hey yes you are right it is related with 64 bit machine to fix this you can have a look on my post

    http://ram-a-singh.blogspot.in/2013/03/how-to-fix-microsoftjetoledb40-provider.html





    • Edited by rasingh1 Tuesday, August 27, 2013 4:00 PM link correction
    Friday, March 29, 2013 5:44 AM
  • To get it working for my project I had to first follow your step and then change IIS7 to run 32Bit apps using the command line provided here:

    http://www.iis.net/learn/web-hosting/web-server-for-shared-hosting/32-bit-mode-worker-processes

    My project uses an Access DB.

    Tuesday, July 30, 2013 10:03 PM
  • thank you so much bro.

    i was searching for this solution since last 5 days..

    bt your solution awesome....

    again lots of thx.

    Tuesday, September 3, 2013 11:07 AM
  • just right click on the project -> properties -> build -> change from target any cpu to target x86 -> f5 and it will work

    Peter Koueik

    Target CPU X86

    this is the correct way to me also. this option solved my problems many times.

    I also changed ANY CPU to X86 from the TOOL BAR, upper section of the VS Interface, for several Projects but, some projects gave errors with it. but changing target platform , instead keeping settings of CONFIGURATION are, worked fine.


    pk

    • Proposed as answer by shammakalubo Tuesday, September 24, 2013 3:13 AM
    Tuesday, September 24, 2013 3:13 AM
  • When we uses the ACE or Jet OLEDB provider to access Microsoft Office based data files, like Excel and Access, we would encounter the error “provider is not registered on the local machine” on 64 bit system, even when they are actually registered correctly.

    The problem is that we compile our solution as “Any CPU”. By default the solution on 64 bit system would run as x64 process, but both of Jet and ACE OLEDB provider only have x86 supported versions. An x64 process cannot load x86 component. Then, the error happens.

    The solution is configuring the compile option to be “x86” which would force the application compiled as x86 executable file and run as x86 process.

    Thursday, December 5, 2013 5:31 AM
  • Thanks alot....It worked
    Wednesday, January 8, 2014 7:29 PM