ID:               21928
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         ODBC related
 Operating System: Win2k server
 PHP Version:      4.3.0
 New Comment:

BTW:  I am running MDAC 2.7 SP1


Previous Comments:
------------------------------------------------------------------------

[2003-01-29 00:27:09] [EMAIL PROTECTED]

I'll run your test in the morning.  It might be notable that I can run
my script from the command line and have no problems connecting to the
ODBC DSN.  But when I run it through IIS, it fails.  I ran this same
script on my local win2k pro desktop and it works fine.  This is only
happening on my win2k server.  I searched the net and see lots of
people with this same issue, but cannot find a single one that has a
resolution.

------------------------------------------------------------------------

[2003-01-28 22:40:06] [EMAIL PROTECTED]

I don't believe this is a PHP bug itself at all.  First off what
version of the MDAC are you using?

Second can you try doing the following:

$dbh = odbc_connect();  // yes I know it will fail
$res = odbc_data_source($dbh, SQL_FETCH_FIRST);

And print out the results of the $res, and call the data_source() a few
more times with SQL_FETCH_NEXT instead of SQL_FETCH_FIRST?

Thanks


------------------------------------------------------------------------

[2003-01-28 18:47:07] [EMAIL PROTECTED]

This is a system DSN.

Here is the output from the lines you sent me.

Content-type: text/html
X-Powered-By: PHP/4.3.0

resource(1) of type (odbc link)

------------------------------------------------------------------------

[2003-01-28 18:17:10] [EMAIL PROTECTED]

Is "ti_readonly" a userDSN or a systemDSN?  

Run this EXACT script from the COMMAND LINE on your server and report
the output:

<?php
  var_dump(odbc_connect("ti_readonly","TI_readonly","TI_readonly"));
?>

------------------------------------------------------------------------

[2003-01-28 16:57:44] [EMAIL PROTECTED]

PHP cannot find a valid ODBC datasource.  Even though the DSN has been
verified and connected to with other products like MS access.  The DSN
points to a SQL Server database.  To complicate matters, PHP can see a
DSN that was previously created on for the same SQL server instance. 
But when trying to create any new DSN, PHP cannot see it.  This app was
run on my local win2k pro box and worked fine.  When I moved it to my
Win2k server, it cannot fins the ODBC DSN.  I see other bug posts that
have had the same problem, yet reponses say that it is not a bug.

Line 10 > 
$connect_TI = odbc_connect("ti_readonly","TI_readonly","TI_readonly");

Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name
not found and no default driver specified, SQL state IM002 in
SQLConnect in c:\inetpub\wwwroot\survey\survey.php on line 10

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21928&edit=1

Reply via email to