In an effort to give ADODB a chance and not use my own Oracle classes...
I am receiving an error trying to connect with adodb.inc.
The error is:
Warning: ocilogon() [function.ocilogon]: _oci_open_server: ORA-12560: TNS:protocol adapter error in c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\framework\Data\adodb\drivers\adodb-oci8.inc.php on line 211
Fatal error: Uncaught exception 'ADODB_Exception' with message 'oci8 error: [12560: ORA-12560: TNS:protocol adapter error ] in CONNECT(, '', '****', ) ' in c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\framework\Data\adodb\adodb-exceptions.inc.php:75 Stack trace: #0 c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\framework\Data\adodb\adodb.inc.php(421): adodb_throw('oci8', 'CONNECT', 12560, 'ORA-12560: TNS:...', '', '', Object(ADODB_oci8)) #1 c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\framework\Data\TAdodb.php(288): ADODB_oci8->Connect('', '', '', '') #2 c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\framework\Data\TAdodb.php(121): TAdodb->open() #3 c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\class\DDAControls\FUser.php(189): TAdodb->__call('Connect', Array) #4 c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\class\DDAControls\FUser.php(189): TAdodb->Connect(false, 'dda in c:\program files\apache group\Apache\htdocs\dev\color_dda_project\v1.00\framework\Data\adodb\adodb-exceptions.inc.php on line 75
I can connect with SQLPlus without any issues.
I have been googling for help and going over the ADODB manual as well, with not a lot of success. Plus, I have also looked in the mailing list and the phpLENS forum for ADODB support.
Here is the php connection snippet and the tnsnames file entry.
Any direction or help would be greatly appreciated.
Thank you for reading this post.
PHP snippet
$sql = "SELECT object_name, pword, status, user_role
FROM tab_dda_user a, tab_dda_object b
WHERE b.object_name = 'TODDP'
AND a.object_id = b.object_id
AND pword = 'TODDP'
AND STATUS = 'Y'
AND USER_ROLE != 'APP'";
$username = strtoupper(trim($username));
$password = strtoupper(trim($password));
$this->dbc = new TAdodb("oci8");
$this->dbc->setDriver("oci8");
$this->dbc->Connect(false, $user, $pass, 'INETTEST.ENG.DTN.COM');
try {
$this->rs = $this->dbc->Execute($sql);
print_r('rs: '.$this->rs);
//-------------------------------------------------------
while ($arr = $this->rs->FetchRow()) {
if ($arr != NULL || $arr != ''){
$succeed = true;
} else {
$succeed = false;
}
}
//-------------------------------------------------------
$this->dbc->close;
unset($this->dbc);
$this->dbc = false;
} catch (exception $e) {
//var_dump($e);
adodb_backtrace($e->gettrace());
print('Catch');
}
tnsnames file entry:
INETTEST.ENG.DTN.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = inet-test.eng.dtn.com)(PORT = 1521))
)
(CONNECT_DATA = (SID = inettest)(SERVER = DEDICATED))
)