A CLI error is issued when you try to connect to DB2 using SAS/ACCESS® Interface to ODBC


When you access DB2 using SAS/ACCESS Interface to ODBC, the following error might occur.

ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver
Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

However, connecting through the ODBC Administrator works successfully.

Workarounds

To work around the error, do one of the following:

Older versions of the DB2 ODBC driver (9.5 and earlier) require the DB2USERS group. With ODBC DB2 9.7 or later, the DB2USERS is not needed, but installing a full version of the ODBC DB2 drivers resolves the issue.