Bug #10580 Updated: Access Violation using ADODB

From: Date: Sat, 19 May 2001 02:45:44 +0000
Subject: Bug #10580 Updated: Access Violation using ADODB
Groups: php.dev 
Request: Send a blank email to php-dev+get-55863@lists.php.net to get a copy of this message
ID: 10580 User Update by: jason@hspace.net Old-Status: Closed Status: Open Bug Type: COM related Operating system: Win2k PHP Version: 4.0.7-dev (dated 18-May-2001) Description: Access Violation using ADODB Hi, The current version (18-May) could not load in Windows at all, so I cannot test that version. Curiously, the version number of PHP is 4.0.7-dev. Testing the last version (17-May), I found that the error is generated when it executes this line of code: for ($rowcount = 0; !$rs->EOF; ++$rowcount, $rs->MoveNext()) { // some code } Specifically, it is the condition ( $rs->EOF ) that causes the Access Violation. All else works ok. $rs->EOF should return a boolean datatype. MSXMLParser also still causes Access Violation when calling loadXML($xmldata) When running PHP as CGI (for the MSXMLParser script), I get this Application Error message: "The instruction at "0x1008d824" referenced memory at "0x3c0a3e64". The memory could not be "written"." The last version that worked with COM was PHP 4.0.6-dev, before it turned 4.0.7-dev. Previous Comments: --------------------------------------------------------------------------- [2001-05-18 11:24:23] phanto@php.net is it ? i was able to run your ado script successfully. are you using the isapi or the cgi version of php. isapi isn't stable yet. -harald --------------------------------------------------------------------------- [2001-05-16 08:42:01] jason@hspace.net COM broken in PHP version 4.0.7-dev --------------------------------------------------------------------------- [2001-05-16 08:34:57] jason@hspace.net Bug reopened, CVS dated 16 May 2001, message when accessing database: PHP has encountered an Access Violation at 011CD614 --------------------------------------------------------------------------- [2001-05-08 20:12:03] phanto@php.net works here. the only mistake i found was, that if either the connect string or the query was wrong $conn->execute() returned a nullpointer instead of a valid recordset. this only produced a warning so there was a nullpointer exception at the first attempt to access $rs->... now i produce an error (unfortunatelly this causes the script to stop). i'll fix this in the code and switch back to a warning, but i think it's ok for now. --------------------------------------------------------------------------- [2001-05-08 19:18:07] jason@hspace.net Here is a code snippet for testing ADODB: <?php define ("DSN_USER", "sa"); define ("DSN_PWD", ""); define ("DB_SERVERNAME", "localhost"); define ("DATABASENAME", "Northwind"); define ("OLEDB_CONNECTION_STRING", "Provider=SQLOLEDB; Data Source=".DB_SERVERNAME."; Initial Catalog=".DATABASENAME."; User ID=".DSN_USER."; Password=".DSN_PWD); $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); $conn->Open(OLEDB_CONNECTION_STRING); $command = "SELECT * from employees"; $rs = $conn->Execute($command); // Recordset $num_columns = $rs->Fields->Count(); $this->set_arr($num_columns); for ($i=0; $i < $num_columns; $i++) { $fld[$i] = $rs->Fields($i); } $rowcount = 0; while (!$rs->EOF) { for ($i=0; $i < $num_columns; $i++) { $arr[$i][$rowcount] = $fld[$i]->value; } $rowcount++; // increments rowcount $rs->MoveNext(); } $rs->Close(); $conn->Close(); $rs = NULL; $conn = NULL; ?> This produces the error: PHP has encountered an Access Violation at 2474FF04 You can also produce an Access Violation by trying to use MSXML Parser 3.0, and by calling the loadXML() method. I downloaded php 4.0.6-dev [2001-05-04] build from php4win32.sourceforge.net/releases/php-4.0.6-dev-20010504.exe --------------------------------------------------------------------------- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. Full Bug description available at: http://bugs.php.net/?id=10580

« previous php.dev (#55863) next »