#18941 [NEW]: odbc_columns returns SQL ERROR

From: Date: Fri, 16 Aug 2002 17:13:27 +0000
Subject: #18941 [NEW]: odbc_columns returns SQL ERROR
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17032@lists.php.net to get a copy of this message
From:             mlambert@kodak.com
Operating system: Win NT 4.0
PHP version:      4CVS-2002-08-16
PHP Bug Type:     ODBC related
Bug description:  odbc_columns returns SQL ERROR 

As originally reported in bug # 18629, odbc_columns returns SQL state 00000
error with Access database.

Using php snapshot 16-Aug-02 12:24 in command line mode.

$qid=odbc_columns($c,"D:\ekos\RXCoating","","Slots","");

I know from using iSQL Viewer that the column information can be retrieved
using ODBC and the MS Access driver. Turning on SQL tracing shows that the
problem lies with "" 
vs <empty string>. Empty strings are passed as pointer to (possibly) ""
whereas a null pointer appears to be  required.

 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 SQL log shows the same problem with odbc_specialcolumns.
odbc_statistics,odbc_foreignkeys, and odbc_primarykeys also give the same
SQL state 00000 errors. 
 Howerver odbc_tables works fine with ""  passed to SQLTablesW
-- 
Edit bug report at http://bugs.php.net/?id=18941&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=18941&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=18941&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=18941&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=18941&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=18941&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18941&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=18941&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=18941&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=18941&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=18941&r=globals



Thread (4 messages)

« previous php.bugs (#17032) next »