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.


-----Original Message-----
From: Bug Database [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 9 May 2001 6:31 AM
To: [EMAIL PROTECTED]
Subject: Bug #10580 Updated: Access Violation using ADODB


ID: 10580
Updated by: phanto
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: COM related
Operating system:
PHP Version: 4.0.6-dev (dated 20010504)
Assigned To:
Comments:

could you provide a short snippet, i can't reproduce this. are you using the
cgi or the isapi version ?

Previous Comments:
---------------------------------------------------------------------------

[2001-05-04 22:54:14] [EMAIL PROTECTED]
Same bug, access violation using ADODB and MSXML Parser, but using a 4.0.6
build, dated 2001-05-04.

---------------------------------------------------------------------------

[2001-05-04 11:29:31] [EMAIL PROTECTED]
This is now fixed in CVS. Fix will be in 4.0.6.  --Jani

---------------------------------------------------------------------------

[2001-05-04 10:28:01] [EMAIL PROTECTED]
same as #10594

---------------------------------------------------------------------------

[2001-05-01 11:05:52] [EMAIL PROTECTED]
If it helps, here is the error message:  PHP has encountered an Access
Violation at 2474FF04  I got the following error messages when using MSXML
Parser 3.01 to load an XML string:  PHP has encountered an Access Violation
at 011C2655  and  PHP has encountered an Access Violation at 011C265B

---------------------------------------------------------------------------

[2001-05-01 10:54:02] [EMAIL PROTECTED]
Access Violation on this line:  $fields = $rs->Fields;  where $rs is the
recordset from the database. Error occurs with PHP 4.0.5 final release, and
does not occur with PHP 4.0.5 RC1.

---------------------------------------------------------------------------

The remainder of the comments for this report are too long.  To view the
rest of the comments, please view the bug report online.


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at
http://bugs.php.net/?id=10580&edit=2



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to