11 November 2008

ODBC driver could not load due to system error 5 (IBM DB2 ODBC DRIVER)

I'm working with DB2 database for the my ASP pages and I run into this error.
"ODBC driver could not load due to system error 5 (IBM DB2 ODBC DRIVER)" after DBA made some changes to DB2 server. Before that, I can connect the DB2 database from ASP pages.

After I googled and found this solution work for me. :)

http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14163479&#14163479

Thanks alot to Keit.

1. add IUSR_computername read & execute permission to "SQLLIB" folder.
2. add IUSR_computername to the DB2USERS group in the computer management\local user and group\ groups.
3. restart IIS Admin in the services.


For my case, IIS and DB2 are in the same box. If you use different boxes you can download and try "IBM Driver for ODBC and CLI from IBM DB2 Software"

http://www-306.ibm.com/software/data/db2/ad/deploy.html
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-dm-db2clidriver.

File name is "db2_v9_nt32_db2driver_for_odbc_cli.zip", may be vary in the future due to the version release. For the time being this is the latest version, I found in IBM website.

Here is the installation step:

Extract to C:\progarm files\IBM\SQLLIB\

1. run db2oreg1.exe -i

2. Open C:\windows\ODBCINST.ini

3. edit the "IBM DB2 DRIVER for ODBC - c:\progra~1\..." to "IBM DB2 ODBC Driver" at the top and bottom places of the file.

4. Run regedt32 and find the entry "IBM DB2 DRIVER for ODBC - c:\progra~1\..." and change it also to "IBM DB2 ODBC Driver".

Steps 2 to 4 are optionals. These steps are only for changing default installed name to "IBM DB2 ODBC Driver".

"IBM DB2 ODBC Driver" is default name instant for DB2 driver listed in "Data Sources (ODBC)" of the control panel. So, you do not need to change connection string driver name when you host to live environment.

I tried this way on the development environment, it does not need to do the above user right adding steps and it works.

:) Happy Programming.

No comments: