#21928 [Fbk->Opn]: Cannot find valid ODBC DSN
| From: | Matt dot hintze at nana dot com | Date: | Wed, 29 Jan 2003 18:23:54 +0000 |
| Subject: | #21928 [Fbk->Opn]: Cannot find valid ODBC DSN | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31606@lists.php.net to get a copy of this message | ||
ID: 21928
User updated by: Matt.hintze@nana.com
Reported By: Matt.hintze@nana.com
-Status: Feedback
+Status: Open
Bug Type: ODBC related
Operating System: Win2k server
PHP Version: 4.3.0
New Comment:
This is what I ran from IIS
<?
$dbh = odbc_connect(); // yes I know it will fail
$res = odbc_data_source($dbh, SQL_FETCH_FIRST);
echo $res;
$res = odbc_data_source($dbh, SQL_FETCH_NEXT);
echo $res;
?>
These are the results.
Warning: Wrong parameter count for odbc_connect() in
c:\inetpub\wwwroot\survey\test.php on line 3
Warning: odbc_data_source(): supplied argument is not a valid ODBC-Link
resource in c:\inetpub\wwwroot\survey\test.php on line 4
Warning: odbc_data_source(): supplied argument is not a valid ODBC-Link
resource in c:\inetpub\wwwroot\survey\test.php on line 6
Previous Comments:
------------------------------------------------------------------------
[2003-01-29 07:19:09] kalowsky@php.net
kept as feedback until testing done...
------------------------------------------------------------------------
[2003-01-29 00:29:25] Matt.hintze@nana.com
BTW: I am running MDAC 2.7 SP1
------------------------------------------------------------------------
[2003-01-29 00:27:09] Matt.hintze@nana.com
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] kalowsky@php.net
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] Matt.hintze@nana.com
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)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21928
--
Edit this bug report at http://bugs.php.net/?id=21928&edit=1