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.
[PHP]<?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.";Po rt=446;Protocol=TCPIP;".
$dns = "Driver={iSeries Access ODBC Driver};Database=".$DBName.";Hostname=".$Host.";Po rt=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";
}
?>[/PHP]
I continue to get the following error no matter what I do:
Expand|Select|Wrap|Line Numbers
- 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
Expand|Select|Wrap|Line Numbers
- 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