Link to home
Start Free TrialLog in
Avatar of DColin
DColinFlag for Thailand

asked on

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

Hi Experts,

I have an aspx page that is creating a db connection using the following code:

dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=C:/DB/MyDb.mdb")
        dbconn.Open()

When I access the page I get the following error:

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

How do I register the db connection?
Avatar of Big Monty
Big Monty
Flag of United States of America image

Are you running your application on x64 or x86 version of Windows?

If so, I would suggest changing the Platform Target build option for your application to target x86 rather than Any CPU. Currently it appears that you are loading some assemblies out of the x64 GAC which would indicate that you are running x64 windows and Microsoft.Jet.OLEDB.4.0 provider is not 64-bit compatible.

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

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
Avatar of DColin

ASKER

Big Monty,

There is no solution to build. This is an aspx web page written as a text file with an aspx extension that is uploaded to my server. When the web page is accessed the server builds the code on the fly and executes it.
are you running 64 bit windows?
Avatar of DColin

ASKER

Windows Server 2008 R2 Standard 64 bit
Avatar of DColin

ASKER

I have written several Windows applications that are running without problems on this server and use the same connection string as the aspx page.
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial