2
votes

I'm running Win7 64-bit and Firebird 2.5.2.

Is it possible to access a 32-bit Firebird database via ODBC from a 64-bit C++ application? My initial thought was that I could just install the 64-bit Firebird ODBC driver and it would work. Sure enough, after installing it the 64-bit ODBC control panel app shows the Firebird driver, but the connection fails when trying to point it to an .fdb file created with 32-bit Firebird. I'm picking the client library from the 64-bit firebird install as well (C:\Program Files\Firebird\Firebird_2_5\bin\fbclient.dll).

Any suggestions on accessing a 32-bit Firebird database via ODBC from a 64-bit C++ application?


EDIT:

My bad, looks like its working fine. I must have accidentally mixed some 32- and 64-bit pieces of the config when setting things up. Once I ensured that I was 1) running the 64-bit server, 2) using a 64-bit ODBC data source which 3) referred to the 64-bit client DLL (from the 64-bit Firebird install) my 64-bit C++ app connected with no issue.

I thought I checked those but I must have missed something in going between 32- and 64-bit.

1
The connection fails is not describing well what happens. Do you get a error message? copy it to your question, along with the relevant parameters you set to your connection. - jachguate
no error message, it just gives a generic failure when adding the ODBC data source and clicking "Test Connection". - Nerdtron
my bad; its working now. Looks like I must have mis-matched 32- and 64-bit pieces when setting things up. - Nerdtron
Your item 1 could also be a 32 bit server, that will work as well. The thing that matters is that all components on the client side (your items 2 and 3) are the same bitness. - Mark Rotteveel
I have made a 32/64 bit ODBC Firebird Driver Matrix that could help you choose the right Firebird odbc driver and by design Firebird client (32 or 64 bit) can talk to any Firebird server (32 or 64 bit). firebirdnews.org/?p=8032 - Mariuz

1 Answers

2
votes

See edit in original post. The problem was mixing some of the 32- and 64-bit pieces in the config. Its working now. You definitely can access the 32-bit database from the 64-bit app once setup properly. Also according to Mark Rotteveel you can run the 32-bit server and use that from the 64-bit app as long as you're using the 64-bit pieces on the app side.