#16720 [Com]: fatal error using MS ADOX-library
| From: | webber123456 at hotmail dot com | Date: | Thu, 13 Feb 2003 09:25:49 +0000 |
| Subject: | #16720 [Com]: fatal error using MS ADOX-library | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32996@lists.php.net to get a copy of this message | ||
ID: 16720
Comment by: webber123456@hotmail.com
Reported By: a.fakos@web.de
Status: Closed
Bug Type: COM related
Operating System: Windows 2000 SP2 German
PHP Version: 4.1.2
New Comment:
status should be open
cannot close activeconnection for disconnected recordset
ver 4.2.3
Previous Comments:
------------------------------------------------------------------------
[2002-05-30 19:21:28] phanto@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2002-04-27 06:22:51] a.fakos@web.de
unfortunately, defining $connection as a global or as local variable
won't work. the same error occured:(
------------------------------------------------------------------------
[2002-04-27 06:04:19] phanto@php.net
can you try to define $connection as a global or local variable and not
as a class member. i don't thank that this causes the error but just
lets go for sure ..
------------------------------------------------------------------------
[2002-04-21 09:53:18] a.fakos@web.de
php binary: v4.1.2 downloaded from www.php4win.de
adodb: ms activex data objects 2.7 library
adox : ms ado ext. 2.5 for dll and security
webserver: apache 1.3.20
......................................................
a fatal error occured with following original message:
"Die Anweisung in '0x100829c3' verweist auf Speicher in 0x00000008. Der
Vorgang 'read' konnte nicht in den Speicher durchgeführt werden."
english (similar):
"Statement at '0x100829c3' refers to memory 0x00000008. memory-process
'read' could not be executed"
error log: Premature end of script headers: path-to/php.exe
......................................................
at the end of this bug-report i post a sample-script, which you can
test it. trivial: the fatal error occured always if the script is
finished.
please look in function tableExists, statement @$cat-ActiveConnection.
the supply of an adodb.connection object
occurs fatal error with an access oledb-provider as sql-server
oledb-provider.
......................................................
<?php
class test {
var $connection;
var $user = "Admin";
var $pw = "";
var $connstr = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=path-to\Nordwind.mdb;
Persist Security Info=False";
function test()
{
$this->connection = new COM("ADODB.Connection");
if (!$this->connection) {
die (print "could not create an instance of
adodb.connection");
}
@$this->connection->Open($this->connstr, $this->user,
$this->pw);
}
function tableExists($value)
{
$ok = false;
$cat = new COM("ADOX.Catalog");
if ($cat) {
//@$cat->ActiveConnection = $this->connection; //<-- with
this statement we receive a fatal error
@$cat->ActiveConnection =
$this->connection->ConnectionString; //<-- but setting the conn-string
works fine
$tables = @$cat->Tables;
$count = $tables->Count();
for($i = 0; $i < $count; $i++) {
$table = $tables->Item($i);
if (strtolower($table->Type) != "view" &&
strtolower($table->Name) == strtolower($value))
{
$ok = true;
break;
}
}
$table->Release(); $table = null; unset($table);
$tables->Release(); $tables = null; unset($tables);
$cat->Release(); $cat = null; unset($cat);
}
return $ok;
}
} // end class
$test = new test();
$ret = $test->tableExists("dummy_table");
echo (integer) ret;
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16720&edit=1