Skip to main content

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

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


This is the error which most of the people face, I also faced this error and searched in google and found a lot of websites which are giving solution to the problem(The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine') , but this is of no use.

But there are some websites which can really help you in this matter, This error you can also get while compiling an application in machines like x64 or x86.
There are two solutions to it

1) If you are in development (Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine)

To solve this issue open the project in Visual Studio then:

1. From the solution explorer right-click on project name then click on Properties
2. Click on the Build tab
3. Change Platform target from: Any CPU to x86
4. Re-build your solution
5. You are good to go


2) If your application is hosted on IIS(Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine)

This will happen if you have an Ms Office application/DLL incorporated in you application, Very simple steps

1) Open IIS manager
2) Select Application Pools
3) Select the application pool you are using in your website
4) Click on Advanced Settings in the right-pane of the window.  
5) Under General section, set "Enable 32-Bit Applications" to "True".
6) Done Enjoy,

You may also want to look at some of my other postings like



Comments

Popular posts from this blog

Static Keyword in C#, unleashing Static keyword in C#

What is Static keyword in C# “Static” keyword can be used for declaring a static member . The keyword Static can be applied to the Classes, field, method, properties, operator, event and constructors. Methods and variable  which we use as static doesn't need an instance to be created of a class. Example of static keyword class testclass {     public static int statint;     public static void squareroot(); } we can call the above static method and variable without creating the instance of the class How to call a static method  testclass.squareroot(); apart from this the static method can use only the static variables of same class.

string is null or empty(String.IsNullOrEmpty)

You can check for the strings in the code, There are many things which  you have to consider before you use a string. Declare the string variable and assign it if (String.IsNullOrEmpty(StringVariable)) {   return "is null or empty" ; else return String.Format( "(\"{0}\") is neither null nor empty" , s); } This will check if the string is null or empty and will return a boolean response.

Usage of Ternary Operator

You can optimize the code by using the ternary operator, pass a parameter to this function it will compare the salary with the given value and if the condition satisfied It will print the value before the colon and if not satisfied it will print the value after colon. Ternary Operator (?:) condition ? condition satisfied : Condition not satisfied string TernaryOperatorUsage(int Salary) {     return salary >= 5000 ? "Congratulations! You are eligible for a pay hike." :                        "Sorry! You're not eligible for a pay hike."; } The above example illustrates the use of ternary operator in your code.