PHP 4.0 Bug #9982 Updated: odbc_tables fails without closing previous database
| From: | badams at ingenico dot com dot au | Date: | Tue, 17 Apr 2001 03:15:17 +0000 |
| Subject: | PHP 4.0 Bug #9982 Updated: odbc_tables fails without closing previous database | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51758@lists.php.net to get a copy of this message | ||
ID: 9982
User Update by: badams@ingenico.com.au
Old-Status: Feedback
Status: Open
Bug Type: ODBC related
Description: odbc_tables fails without closing previous database
$dbname is an array of ODBC data sources.
The number of ODBC connections isn't an issue. It fails on the second call to odbc_tables. The
only way to stop the error is to close all connections and open again before called odbc_tables.
This fails on php4.0.4 but I do not have 4.0.5 yet.
thanks
Previous Comments:
---------------------------------------------------------------------------
[2001-04-16 22:50:08] kalowsky@php.net
what is $dbname, and is it possible you've run out of available ODBC connections with your
first example? you are opening up N number of OBDC connections...
and finally does this still exist in the current 4.0.5 or even 4.0.4pl1 releases?
---------------------------------------------------------------------------
[2001-03-25 22:42:20] badams@ingenico.com.au
If calling odbc_tables in a loop the database connection must be closed before callign odbc_tables
again.
Error
Exception: access violation 0xc0000005)
eg
This FAILS
for($i=0; $i<sizeof($dbname); $i++)
{
$conn = odbc_conn($dbname[$i], $name, $pword);
$res = odbc_tables($conn);
$n = 1;
while( odbc_fetch_row($res, $n))
{
...
}
}
odbc_close_all( );
Yet this works fine
for($i=0; $i<sizeof($dbname); $i++)
{
$conn = odbc_conn($dbname[$i], $name, $pword);
$res = odbc_tables($conn);
$i = 1;
while( odbc_fetch_row($res, $i))
{
...
}
odbc_close_all( );
}
Thanks in advance...
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=9982