Can I can connect a 32-bit application to a 64-bit ODBC driver?
Yes, you can connect a 32-bit application to a 64-bit ODBC driver by using the ODBC-ODBC Bridge.
Without the ODBC-ODBC Bridge, a 32-bit application can't connect to a 64-bit ODBC driver. 32-bit applications must be linked against 32-bit libraries. For this reason, 32-bit applications can only link against a 32-bit ODBC Driver Manager library. 32-bit ODBC Driver Managers can only load 32-ODBC drivers.
The ODBC-ODBC Bridge is a client/server product. The ODBC-ODBC Bridge client is not linked against the ODBC-ODBC Bridge server. The ODBC-ODBC Bridge client communicates with the ODBC-ODBC Bridge server by using the Remote Procedure Call (RPC) mechanism. You can use a 32-bit ODBC-ODBC Bridge client with a 64-bit ODBC-ODBC Bridge server and vice versa.
To connect a 32-bit application with a 64-bit ODBC driver, you use a 32-bit ODBC-ODBC Bridge client and a 64-bit ODBC-ODBC Bridge server.
ODBC calls made by your 32-bit application are passed from the 32-bit ODBC driver (the ODBC-ODBC Bridge client) to the target 64-bit ODBC driver through the 64-bit ODBC-ODBC Bridge server.
Example: How to connect a 32-bit application to a 64-bit ODBC driver
The following steps show how to access a 64-bit ODBC driver from a 32-bit application on a 64-bit Windows machine. The ODBC driver is the Microsoft SQL Native Client driver. The application is Visual Studio 2010.
- In the 64-bit ODBC Data Source Administrator, configure a system data source for the SQL Native Client driver.
To access the 64-bit ODBC Data Source Administrator, enter the following command in the Windows Run dialog box:
odbcad32.exe
- Install the 64-bit Windows ODBC-ODBC Bridge distribution.
Accept the Default option during Setup, which will install both the ODBC-ODBC Bridge client and server components.
- In the Windows Services dialog box:
- Stop the 32-bit ODBC-ODBC Bridge server service (
Easysoft ODBC-ODBC Bridge Server
). - Start the 64-bit ODBC-ODBC Bridge server service (
Easysoft ODBC-ODBC Bridge Server x64
).
- Stop the 32-bit ODBC-ODBC Bridge server service (
- In the 32-bit ODBC Data Source Administrator, configure an ODBC-ODBC Bridge client data source that points to the SQL Native Client driver data source.
To access the 32-bit ODBC Data Source Administrator, enter the following command in the Windows Run dialog box:
%windir%\syswow64\odbcad32.exe
- In a Visual Studio 2010 project, choose Data menu > Add New Data Source.
The Data Source Configuration Wizard starts.
- Select Database on the Choose a Data Source Type page.
- Select Dataset on the Choose a Data Model page.
- Select New Connection on the Choose Your Data Connection page.
- In the Choose a Data Source dialog box, select Microsoft ODBC data source.
- In the Add Connection dialog box, choose your ODBC-ODBC Bridge client data source from the Use user or system data source name list.
- Complete the remainder of the Data Source Configuration Wizard.