[unixODBC-support] DB2, Driver's SQLAllocHandle on SQL_HANDLE_HENV failed

Nathan Sandland nsandland at novell.com
Mon Jul 3 17:22:52 BST 2006


I am trying to connect through unixodbc to a DB2 database, and keep
getting the following error:

    prak:/home/db2inst2 # isql vigo_prod vcmprod ******** -v
    [IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on
    [ISQL]ERROR: Could not SQLConnect

Nearly everything I've found indicates that this error has to do with
not having the DB2INSTANCE set properly.  However, I have run db2profile
to do so, and DB2INSTANCE is correct:

    prak:/home/db2inst2 # echo $DB2INSTANCE

I am able to connect to DB2 through the db2 command line client:

    db2 => connect to vcmprod user vcmprod
    Enter current password for vcmprod:

       Database Connection Information

     Database server        = DB2/LINUX 8.1.6
     SQL authorization ID   = VCMPROD
     Local database alias   = VCMPROD

Note that I am running 64 bit SUSE linux--perhaps that has something to
do with it?

Here are the various versions of software I have:
    SLES 9, 64 bit
    DB2 Database 8.1.6
    DB2 Client 8.2
    UnixODBC 2.2.11 (have also tried 2.2.8)

And my odbcinst.ini:
    Description             = DB2 ODBC Driver
    Driver          = /opt/IBM/db2/V8.1/lib64/libdb2.so
    FileUsage               = 1
    DontDLClose             = 1
    Debug           = 1
    UsageCount              = 2

    Trace           = Yes
    Tracefile               = /var/log/odbc_trc.log
    UsageCount              = 2

And my odbc.ini:
    Description             = Vignette Production Stage on vigo
    Driver          = DB2
    DMEnvAttr               =

Please help! :)

Nathan Sandland

More information about the unixODBC-support mailing list