Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

ODBC Connection

Dim inNewConnetion As OdbcConnection = New OdbcConnection(String.Format("Driver={{Microsoft Access Driver (*.mdb, *.accdb)}}; Dbq={0}; Uid=admin; Pwd=;", inAccessDBName))

inNewConnection.Open()

When I try to open the connection I get the following error.  How do I fix this?

Unable to load odbcji32.dll

OS: Windows 8.1
Apps installed: MS Access 2013
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

At a guess (the 32 in the error message) you have compiled your app as any cpu (or explicitly 64 bit cpu) which means it can't call a 32 bit dll.
The solution is to change the properties of your app so it compiles only as 32 bit.
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland 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
Avatar of RayT

ASKER

After making the suggested change I get the following error:

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

What's needed to fix this?
That is a totally different question (sounds like the ODBC connection you want to use is not configured) , you ought to close this and ask a new question for that.