Why do I get "IM004, Driver's SQLAllocHandle on SQL_HANDLE_HENV failed" connecting to DB2?
This error generally occurs on UNIX because the environment variable DB2INSTANCE has not been set and exported before the Easysoft ODBC-ODBC Bridge Server starts up. You need to either:
- Edit
easysoft_installation_dir/oob/server/serverand add:DB2INSTANCE=xyz export DB2INSTANCE
before the
cdat the end of the file.-Or
- Set
DB2INSTANCEand export it before startingesoobserverstandalone.
Alternatively, if you are using the unixODBC Driver Manager, you can use SQL_ATTR_UNIXODBC_ENVATTR in the odbc.ini file to set environment variables at DSN-level.