728x90

Question

On DB2 UDB Version 8 FixPak 11 or later, after following the steps to set up the unixODBC driver manager as stated in the documentation section "Setting up the unixODBC Driver Manager", you receive the following error when you test the connection:

$ isql -v testdb username mypassword 
[IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on 
SQL_HANDLE_DBC failed 
[ISQL]ERROR: Could not SQLConnect

Cause

Documentation incorrectly states to use

Answer

The following step in the documentation is NOT necessary for DB2 UDB Version 8 FixPak 11 or above.

For AIX only: Extract the shared library from the ODBC driver for DB2 to yield
shr.o on 32-bit platforms and shr_64.o on 64-bit platforms: 

cd /u/db2inst1/sqllib/lib
ar -x libdb2.a 

cd /u/db2inst1/sqllib/lib
ar -x -X 64 libdb2o.a

The library db2o.o is already bundled with DB2 UDB. You just need to edit your odbc.ini file to use the correct library.

Example:

[TESTDB] 

Description=TEST database 
Driver=/home/username/sqllib/lib/db2o.o



728x90

+ Recent posts