#18628 [Com]: odbc_columns returns SQL error 00000
| From: | mlambert at kodak dot com | Date: | Fri, 16 Aug 2002 15:18:07 +0000 |
| Subject: | #18628 [Com]: odbc_columns returns SQL error 00000 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17022@lists.php.net to get a copy of this message | ||
ID: 18628
Comment by: mlambert@kodak.com
Reported By: jeff.albert@ualberta.ca
Status: Closed
Bug Type: ODBC related
Operating System: Windows 2000 Professional
PHP Version: 4.2.2
New Comment:
On the SQL state error, I knew from using iSQL Viewer that the column
information was available. Turning on SQL tracing shows that the
problem lies with "" vs <empty string>.
Extract from SQL log:
iSQL-Viewer-2_1 49-b7 EXIT SQLColumnsW with return code 0
(SQL_SUCCESS)
HSTMT 0BC25F40
WCHAR * 0x0BC21828 [ -3] "D:\ekos\R"
SWORD -3
WCHAR * 0x00000000 [ -3] <empty string>
SWORD -3
WCHAR * 0x0BC22090 [ -3] "Slo"
SWORD -3
WCHAR * 0x00000000 [ -3] <empty string>
SWORD -3
php -f alt 97-73 EXIT SQLColumnsW with return code -1 (SQL_ERROR)
HSTMT 00CE1A18
WCHAR * 0x00CE1E20 [ -3] "D:\ekos\R"
SWORD -3
WCHAR * 0x00CE15E0 [ -3] ""
SWORD -3
WCHAR * 0x00CE1E58 [ -3] "Slo"
SWORD -3
WCHAR * 0x00CE1E78 [ -3] ""
SWORD -3
The actual code for this example is
$qid=odbc_columns($c,"D:\ekos\RXCoating","","Slots","");
There is a similar conflict with odbc_specialcolumns, but bizzarely,
odbc_tables is happy to accept ""
I stopped the crashing by using pconnect or including odbc_close.
Previous Comments:
------------------------------------------------------------------------
[2002-08-15 15:14:04] jeff.albert@ualberta.ca
The latest snapshot appears to have fixed the crash problem entirely
for all the affected functions including odbc_columns() and
odbc_tables(). It appears that you are correct in asserting that % is
not interpreted properly by the Access driver. Thanks for your help!
Jeff Albert
------------------------------------------------------------------------
[2002-08-12 20:39:19] kalowsky@php.net
Partially fixed.
In your first case, the '%' operator is not really handled at all by
MSAccess as far as I can tell. If you have proof otherwise, please
show me some documentation so I can fully fix this.
The crash case though is now fixed in the CVS. Try a snapshot and see
if this works for you.
------------------------------------------------------------------------
[2002-07-29 14:15:46] jeff.albert@ualberta.ca
Hello,
I will limit this report to odbc_columns, although other odbc functions
appear to be affected similarly:
<?php
$con = odbc_connect("dev", "", "");
$result = odbc_columns($con, "", "", "", "%");
?>
The above code will produce an SQL State 00000 error when connecting to
an MS Access 2000 database through ODBC on a Windows 2000 Professional
box. PHP is version 4.2.2, and the problem appears to occur in both
Apache 1.3.* and 2.0.39.
<?php
$con = odbc_connect("dev", "", "");
$result = odbc_columns($con);
?>
Calling odbc_columns without the extra parameters actually causes
php.exe to crash altogether under the same environment.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18628&edit=1