odbc - Access - unhandled exception, output hangs

From: Date: Fri, 26 Nov 1999 17:21:48 +0000
Subject: odbc - Access - unhandled exception, output hangs
Groups: php.version4 
Request: Send a blank email to php-version4+get-6939@lists.php.net to get a copy of this message
I'm a php newbie, but am very impressed with its power (and the fact that Bill Gates does not benefit from its use). In my spare time, I am helping a local school set up an intranet, and part of the job involves accessing sundry MS Access databases they have around the place. I'm working on NT4 running IIS with the ISAPI version of php 4.0b3. Everything is almost working very sweetly except I encounter a problem every time I do an odbc_prepare or odbc_exec call. The function call works fine and the correct results are generated (and displayed if I do an odbc_result_all), but the output from php hangs once all of the page has been output - ie the browser still thinks that there is more to come. The system log in the event viewer shows an error, source WAM, description The HTTP server encountered an unhandled exception while processing the ISAPI Application 'C:\WINNT\system32\php4isapi.dll'. I would be most grateful if anyone could point me towards a solution. Here's a simple page that causes the error (as a data source I'm using the adventureworks database which comes with the IIS for use with an ASP example): <html> <head></head> <body> <?php $a=odbc_connect("Adventure","",""); /*always returns 1 (NB I've tried this with sundry cursor types but with no change in behaviour)*/ if(!$a) { print("failed connecting"); exit(); } $test=odbc_exec($a,"select ShipDate from Orders where ShipCity='Anchorage'"); /*always returns 2*/ if(!$test) { printf("failed in exec"); odbc_close($a); exit(); } $closed=odbc_close($a);/*always returns 0*/ ?> </body> </html> If it helps, here's the output of the ODBC trace: inetinfo 119:11f ENTER SQLAllocEnv HENV * 0x002b4890 inetinfo 119:11f EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS) HENV * 0x002b4890 ( 0x05801500) inetinfo 119:11f ENTER SQLAllocConnect HENV 0x05801500 HDBC * 0x002b4894 inetinfo 119:11f EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS) HENV 0x05801500 HDBC * 0x002b4894 ( 0x058022e0) inetinfo 119:11f ENTER SQLConnectW HDBC 0x058022e0 WCHAR * 0x058016b0 [ -3] "Adventure\ 0" SWORD -3 WCHAR * 0x1f4be05c [ -3] "******\ 0" SWORD -3 WCHAR * 0x1f4be05c [ -3] "******\ 0" SWORD -3 inetinfo 119:11f EXIT SQLConnectW with return code 0 (SQL_SUCCESS) HDBC 0x058022e0 WCHAR * 0x058016b0 [ -3] "Adventure\ 0" SWORD -3 WCHAR * 0x1f4be05c [ -3] "******\ 0" SWORD -3 WCHAR * 0x1f4be05c [ -3] "******\ 0" SWORD -3 inetinfo 119:11f ENTER SQLAllocStmt HDBC 0x058022e0 HSTMT * 0x002b59e0 inetinfo 119:11f EXIT SQLAllocStmt with return code 0 (SQL_SUCCESS) HDBC 0x058022e0 HSTMT * 0x002b59e0 ( 0x05802520) inetinfo 119:11f ENTER SQLGetInfoW HDBC 0x058022e0 UWORD 8 <SQL_FETCH_DIRECTION> PTR 0x00f3fa74 SWORD 4 SWORD * 0x00f3fa5a inetinfo 119:11f EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS) HDBC 0x058022e0 UWORD 8 <SQL_FETCH_DIRECTION> PTR 0x00f3fa74 SWORD 4 SWORD * 0x00f3fa5a (4) inetinfo 119:11f ENTER SQLSetStmtOption HSTMT 0x05802520 UWORD 6 <SQL_CURSOR_TYPE> UDWORD 2 inetinfo 119:11f EXIT SQLSetStmtOption with return code 1 (SQL_SUCCESS_WITH_INFO) HSTMT 0x05802520 UWORD 6 <SQL_CURSOR_TYPE> UDWORD 2 DIAG [01S02] [Microsoft][ODBC Microsoft Access Driver]Option value changed (10) inetinfo 119:11f ENTER SQLExecDirect HSTMT 0x05802520 UCHAR * 0x0029f7e0 [ -3] "select ShipDate from Orders where ShipCity='Anchorage'\ 0" SDWORD -3 inetinfo 119:11f EXIT SQLExecDirect with return code 0 (SQL_SUCCESS) HSTMT 0x05802520 UCHAR * 0x0029f7e0 [ -3] "select ShipDate from Orders where ShipCity='Anchorage'\ 0" SDWORD -3 inetinfo 119:11f ENTER SQLNumResultCols HSTMT 0x05802520 SWORD * 0x002b59e8 inetinfo 119:11f EXIT SQLNumResultCols with return code 0 (SQL_SUCCESS) HSTMT 0x05802520 SWORD * 0x002b59e8 (1) inetinfo 119:11f ENTER SQLColAttributes HSTMT 0x05802520 UWORD 1 UWORD 1 <SQL_COLUMN_NAME> PTR 0x002a68b0 SWORD 32 SWORD * 0x00f3fa4e SDWORD * 0x00000000 inetinfo 119:11f EXIT SQLColAttributes with return code 0 (SQL_SUCCESS) HSTMT 0x05802520 UWORD 1 UWORD 1 <SQL_COLUMN_NAME> PTR 0x002a68b0 SWORD 32 SWORD * 0x00f3fa4e (8) SDWORD * 0x00000000 inetinfo 119:11f ENTER SQLColAttributes HSTMT 0x05802520 UWORD 1 UWORD 2 <SQL_COLUMN_TYPE> PTR 0x00000000 SWORD 0 SWORD * 0x00000000 SDWORD * 0x002a68d8 inetinfo 119:11f EXIT SQLColAttributes with return code 0 (SQL_SUCCESS) HSTMT 0x05802520 UWORD 1 UWORD 2 <SQL_COLUMN_TYPE> PTR 0x00000000 SWORD 0 SWORD * 0x00000000 SDWORD * 0x002a68d8 (11) inetinfo 119:11f ENTER SQLColAttributes HSTMT 0x05802520 UWORD 1 UWORD 6 <SQL_COLUMN_DISPLAY_SIZE> PTR 0x00000000 SWORD 0 SWORD * 0x00000000 SDWORD * 0x00f3fa50 inetinfo 119:11f EXIT SQLColAttributes with return code 0 (SQL_SUCCESS) HSTMT 0x05802520 UWORD 1 UWORD 6 <SQL_COLUMN_DISPLAY_SIZE> PTR 0x00000000 SWORD 0 SWORD * 0x00000000 SDWORD * 0x00f3fa50 (19) inetinfo 119:11f ENTER SQLBindCol HSTMT 0x05802520 UWORD 1 SWORD 1 <SQL_C_CHAR> PTR 0x002b5ac0 SDWORD 20 SDWORD * 0x002a68d4 inetinfo 119:11f EXIT SQLBindCol with return code 0 (SQL_SUCCESS) HSTMT 0x05802520 UWORD 1 SWORD 1 <SQL_C_CHAR> PTR 0x002b5ac0 SDWORD 20 SDWORD * 0x002a68d4 (91927008) inetinfo 119:11f ENTER SQLDisconnect HDBC 0x058022e0 inetinfo 119:11f EXIT SQLDisconnect with return code 0 (SQL_SUCCESS) HDBC 0x058022e0 inetinfo 119:11f ENTER SQLFreeConnect HDBC 0x058022e0 inetinfo 119:11f EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS) HDBC 0x058022e0 inetinfo 119:11f ENTER SQLFreeEnv HENV 0x05801500 inetinfo 119:11f EXIT SQLFreeEnv with return code 0 (SQL_SUCCESS) HENV 0x05801500 inetinfo 119:11f ENTER SQLFreeStmt HSTMT 0x05802520 UWORD 1 <SQL_DROP> -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org

« previous php.version4 (#6939) next »