|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-07-27 14:08 UTC] fsegtrop at estiem dot org
With PHP 4.0.1pl2 the following script
<?$conn=odbc_connect("TEST","me","me");?>
the error occurs:
Warning: SQL error: [Oracle][ODBC Oracle Driver][Oracle OCI]ORA-12154: TNS:Der Servicename konnte nicht aufgel?st werden.., SQL state S1000 in SQLConnect
With PHP3, the same script works, on the same machine and the same environment.
ODBC is correctly configured, as a login with ODBC-Test works.
Login with SQL Plus also works, so TNS is correctly configured.
It looks as if, with PHP4, ODBC does not look for the tnsnames.ora, which ODBC does with PHP3.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 07:00:01 2025 UTC |
This is the c function that works, and it shows no big difference to the odbc_sqlconnect function used by php4: void myodbcconnect() { int rc; SQLHANDLE henv,hdbc; SQLAllocEnv(&henv); SQLAllocConnect(henv, &hdbc); rc = SQLConnect(hdbc,(unsigned char*)dsn,strlen(dsn),(unsigned char*)uid,strlen(uid),(unsigned char*)pwd,strlen(pwd)); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { MessageBox(hWnd,"","Fehler",IDOK); SQLFreeConnect(hdbc); } else MessageBox(hWnd,"OK","",IDOK); }