Unable to load dynamic library php_ibm_db2.dll

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
repp9418
Forum Newbie
Posts: 10
Joined: Thu Jan 17, 2008 10:37 am

Unable to load dynamic library php_ibm_db2.dll

Post by repp9418 »

HELP!

Setup: PHP5.2.5, IIS 5.1, XP, AS/400 (DB/400 or DB2)

I am trying to connect to a DB2 database from my computer. I installed DB2 Connect and set up the ODBC Driver in the Data Source Administrator. I uncommented the extension=php_ibm_db2.dll line in my php.ini file.

Code: Select all

<?php 
    $DBName = "WSC520";      // The name of the database 
... 
 
    include('adodb/adodb.inc.php'); 
    $db = ADONewConnection('db2'); 
    $db->curMode = SQL_CUR_USE_ODBC; 
    //$dns = "Driver={IBM DB2 ODBC DRIVER};Database=".$DBName.";Hostname=".$Host.";Port=446;Protocol=TCPIP;". 
    $dns = "Driver={iSeries Access ODBC Driver};Database=".$DBName.";Hostname=".$Host.";Port=446;Protocol=TCPIP;". 
        "Uid=".$User.";Pwd=".$Password; 
 
//    if ($db->Connect($Host, $User, $Password)) { 
    if ($db->Connect($dns, $User, $Password, $DBName)) { 
//    if ($db->Connect($dns)) { 
        echo "It worked"; 
    } else { 
        echo "didn't work"; 
    } 
?>
I continue to get the following error no matter what I do:

Code: Select all

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\php-5.2.5\ext\php_ibm_db2.dll' - The specified module could not be found.
 in Unknown on line 0
I think this is causing my other error:

Code: Select all

PHP Warning:  odbc_connect() [<a href='function.odbc-connect'>function.odbc-connect</a>]: SQL error: [IBM][iSeries Access ODBC Driver]Missing system name needed for connection., SQL state S1000 in SQLConnect in C:\EmployeePortal\adodb\drivers\adodb-odbc.inc.php on line 170
Post Reply