How to point to 32 bit IBM DB2 ODBC driver on 64-bit Microsoft system?
I want to create a 32 bit ODBC DSN pointing to 32 bit IBM DB2 ODBC driver for my 32 bit application in a 64-bit environment. How do I run the 32-bit ODBC administrator in a 64-bit environment?
The Microsoft ODBC Data Source Administrator is used by DB2 to create an ODBC DSN.
By default on a Windows 64-bit server, when the 'MicroSoft ODBC Data Source administrator' is run, it will launch the 64-bit version of odbcad32.exe, which can be used to create DSNs pointing to 64-bit IBM DB2 ODBC drivers only.
If you have 32-bit applications running on a 64-bit Windows server, they will need to use the 32-bit ODBC driver. To create DSNs pointing to 32-bit IBM DB2 ODBC driver, the 32-bit 'MicroSoft ODBC Data Source administrator' must be used.
First, it is good to note that both 32-bit and 64-bit ODBC drivers are available on a Windows 64-bit system. Here is where they are located.
32-bit "IBM DB2 ODBC DRIVER" is registered under:
Driver ---> ~\SQLLIB\BIN\DB2CLI.DLL
Setup ---> ~\SQLLIB\BIN\DB2ODBC.DLL
64-bit "IBM DB2 ODBC DRIVER" is registered under:
Driver ---> ~\SQLLIB\BIN\DB2CLIO.DLL
Setup ---> ~\SQLLIB\BIN\DB2ODBC64.DLL
Next it will be helpful to understand how to create a DSN using a specific driver.
Creating DSN pointing to 32-bit IBM DB2 ODBC driver:
Microsoft Windows 64-bit platforms maintain a compatibility feature which enables a 32-bit application to run transparently in a 64-bit environment, known as WOW64, (Windows-32-on-Windows-64). This maintains its own copy of the registry that is only for 32-bit applications.
The data sources using 32-bit IBM DB2 ODBC drivers can be created by using the 32-bit Microsoft ODBC data Source Administrator: C:\WINDOWS\SysWOW64\odbcad32.exe
Using Windows Explorer, browse to the C:\WINDOWS\SysWOW64\odbcad32.exe and double click on the odbcad32.exe to bring up the 32-bit ODBC Data Source administrator.
Using the 32-bit Data Source Administrator, a new ODBC data source can be created for the 32-bit IBM DB2 ODBC driver (DB2CLI.DLL). If multiple DB2 copies are installed, drivers from all of those copies will be listed.
Move the horizontal scroll bar to the right, to see the File column and the 32-bit IBM DB2 ODBC driver - DB2CLI.DLL listed and select one.
To complete the process, select a driver and then follow the prompts to create the DSN.
Creating DSN pointing to 64-bit IBM DB2 ODBC driver:
To open the ODBC Data Source Administrator, follow the below steps:
1. On the Start menu, click Control Panel.
2. In Control Panel, click Administrative Tools.
3. In Administrative Tools, click Data Sources (ODBC).
By default when ODBC administrator is open in 64-bit Windows, it will launch 64-bit 'Micorsoft ODBC Data Source Administrator' which is WINDOWS\system32\odbcad32.exe (the 64-bit version).
Using the above 64-bit Data Source Administrator, new ODBC data source can be created for the 64-bit IBM DB2 ODBC driver(DB2CLIO.DLL) only. If multiple DB2 copies are installed, drivers from all of those copies will be listed.
Move the horizontal scroll bar to the right, to see the File column and the 64-bit IBM DB2 ODBC driver -DB2CLIO.DLL listed and select one.
For further discussion on this topic, visit this developerWorks forum thread:
More support for:
DB2 for Linux, UNIX and Windows
Programming Interface - ODBC
Software version: 9.5, 9.7, 10.1, 10.5, 11.1
Operating system(s): Windows
Reference #: 1384435
Modified date: 09 August 2016
Translate this page: