PHP 4.0 Bug #6683: Cannot pass COM object as parameter to another COM object
| From: | jlim at natsoft dot com dot my | Date: | Tue, 12 Sep 2000 16:21:28 +0000 |
| Subject: | PHP 4.0 Bug #6683: Cannot pass COM object as parameter to another COM object | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32986@lists.php.net to get a copy of this message | ||
From: jlim@natsoft.com.my
Operating system: Windows 98
PHP version: 4.0.2
PHP Bug Type: Scripting Engine problem
Bug description: Cannot pass COM object as parameter to another COM object
This example creates a connection object to a database, creates a recordset, then assigns the
connection object to the recordset using ADO com objects.
<?
$dbc = new COM('ADODB.Connection');
$dbc->Provider = 'MSDASQL';
$dbc->Open('NWIND'); // standard sample access database northwind
$rs = new COM("ADODB.Recordset");
$rs->Open('select * from product',$dbc,3); // 3 = static cursor
?>
OUTPUT ERROR MESSAGE:
Warning: Invoke() failed: Exception occurred. in d:\Inetpub\wwwroot\php\bugado.php on line 6
PHP has encountered an Access Violation at 78002D15
The error is because the COM object $dbc is passed as a parameter to $rs.
I have the same code in ASP. Works fine.