Click here to Skip to main content
15,909,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have done some changes in some existing C# code, when the application is run in debug mode (even directly from the bin\x86\Debug) works fine, however when I choose to run from release folder I am getting the error
C#
Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine


What I have tried:

I have checked the following after visiting some forums:
C#
1. From the solution explorer right-click your project then click Properties
2. Click the Build tab
3. Change Platform target from: Any CPU to x86
4. Re-build your solution


Can any one give me some hints on why the application is not working from the release folder.
Posted
Updated 7-Mar-16 2:51am
Comments
Maciej Los 7-Mar-16 6:22am    
Move the database outside the project folder, change connection string and build it again.

Is your target machine is 64 BIT ? if yes then as you said earlier try to Build it with X86 CPU but this time pick this exe from DEBUG folder not from RELEASE (before that delete all debuggers) and then try again.
 
Share this answer
 
try to register oledb 4.0 on your local machine using command prompt

below are thge step to register jet4.0
if your system is 32 bit
1. Open cmd as administrator
2. type cd c:\windows\System32 press enter
3. type regsvr32 msjet40.dll press enter
4. type regsvr32 msjetoledb40.dll press enter
5. type regsvr32 msjint40.dll press enter
6. type regsvr32 msjter40.dll press enter
7. type regsvr32 msjtes40.dll press enter

note: some dll will not register.

if your system is 64 bit
1. Open cmd as administrator
2. type cd c:\windows\Syswow64 press enter
3. type regsvr32 msjet40.dll press enter
4. type regsvr32 msjetoledb40.dll press enter
5. type regsvr32 msjint40.dll press enter
6. type regsvr32 msjter40.dll press enter
7. type regsvr32 msjtes40.dll press enter

note: some dll will not register.

After registering these dll's test your application
if it again showing popup that "Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine"

Install Office database engine 2007 from the below link
microsoft office access database engine 2007

Hope after doing these your problem should be solved
 
Share this answer
 
C#
1. From the solution explorer right-click your project then click Properties
2. Click the Build tab
3. Change Platform target from: Any CPU to x86
4. Re-build your solution


I was not selecting Active (Release). Once this was selected the .exe from the release folder worked.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900