Question & Answer
Question
This document provides troubleshooting information for the situation where you are attempting to connect to a DB2 UDB database within an ODBC application and receive a message such as the following: SQLSTATE = IM004 Native error = 0 Msg:[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed.
Cause
The new security features introduced in DB2® Universal Database™ (DB2 UDB) Version 8.2 prevent users from using the database unless they belong to the Windows® groups DB2ADMNS or DB2USERS.
Diagnosis Details
In this situation, the message may not appear within CLI traces and an ODBC trace may just indicate that the SQLConnectW() call fails.
Answer
Add the userid (the one used to execute the application) to either the DB2ADMNS or DB2USERS group. Please refer to the link under "Related Information" (below) for instructions on how to accomplish this.
As of DB2 UDB Version 8.1 FixPak 10 (also known as DB2 UDB Version 8.2 FixPak 3), a clearer error message will be returned in situations where enhanced security have been enabled and a userid does not meet these qualifications.
This is accomplished via APAR JR20697 with the message below:
SQL1092N "<authorization-ID>" does not have the authority to perform the requested command.
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21229860