php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16720 fatal error using MS ADOX-library
Submitted: 2002-04-21 09:53 UTC Modified: 2002-05-30 19:21 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: a dot fakos at web dot de Assigned:
Status: Closed Package: COM related
PHP Version: 4.1.2 OS: Windows 2000 SP2 German
Private report: No CVE-ID: None
 [2002-04-21 09:53 UTC] a dot fakos at web dot 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;
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-27 06:04 UTC] 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-27 06:22 UTC] a dot fakos at web dot de
unfortunately, defining $connection as a global or as local variable won't work. the same error occured:(
 [2002-05-30 19:21 UTC] 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.


 [2003-02-13 03:25 UTC] webber123456 at hotmail dot com
status should be open

cannot close activeconnection for disconnected recordset
ver 4.2.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 05:01:28 2024 UTC