RED SOFT ADAIR
RED SOFT ADAIR

Reputation: 12218

Can i use a 32 Bit ODBC Driver for my 64 Bit app

I have a Win32 application that makes ODBC-Connections. We connect using SQLDriverConnect() which displays a dialog to select the data source. In the x64-Version the Dialog shows and offers 2 different 32 Bit MS ACCESS Drivers. When i select one of these, in the 32 Bit version i would see a open file dialog to select a .mdb file. In the 64 Bit version the call to SQLDriverConnect() at this point returns with -1.

SQLError() returns: "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

Is it in general possible to use a 32 Bit ODBC Driver from a 64-Bit executable? Why are these driver shown? As far as i can find there is no 64 Bit MS Access OBDC driver so far. What can i do?

Upvotes: 3

Views: 9630

Answers (4)

You can't, but you have the alternative to compile your app in 32bits, and use the 32bit odbc driver. In my case, I use GoLang just change GOARCH environment variable SET GOARCH=386 then compile your project go build and your all set.

Upvotes: -2

Garry M. Biggs
Garry M. Biggs

Reputation: 279

In order to "bridge" from a 64bit application to a 32bit ODBC driver you would need to employ an ODBC to ODBC Bridge such as -

http://uda.openlinksw.com/odbc-odbc-mt/

This has a 64bit ODBC client component which connects vis sockets to 32bit server components. The server components bridge to a pre-configured 32bit Access ODBC DSN.

Client component can be either on the local machine or a server machine...

Upvotes: 2

Garry M. Biggs
Garry M. Biggs

Reputation: 279

You absolutely cannot mix 32bit application and 64bit driver (or vice-versa).

Basically, an ODBC driver is, typically, a dll (windows) or a shared object (linux...) which is loaded by its parent application.

All executables, dlls, etc that share the same process space must be the same bit'ness...

Upvotes: 6

Doc Brown
Doc Brown

Reputation: 20044

Well, I don't know why SQLDriverConnect() works the way you describe it, but perhaps this Blog post from Microsoft

http://blogs.msdn.com/b/psssql/archive/2010/01/21/how-to-get-a-x64-version-of-jet.aspx

can help you a little bit.

Seems there will be no native 64 bit ODBC driver for MS Access in near future, but those ACE components mentioned there may be an alternative.

Upvotes: 0

Related Questions