ID: 6683
Updated by: phanto
Reported By: [EMAIL PROTECTED]
Old-Status: Assigned
Status: Closed
Bug Type: COM related
Assigned To: phanto
Comments:

fixed in cvs now.

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

[2001-01-29 17:19:12] [EMAIL PROTECTED]
working on it

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

[2000-09-12 19:09:37] [EMAIL PROTECTED]
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:Inetpubwwwrootphpbugado.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.


=========================

I have found the problem in COM.c

443 static void php_pval_to_variant(pval *pval_arg, VARIANTARG *var_arg)
444 {
445         OLECHAR *unicode_str;
446 
447         switch (pval_arg->type) {
448         case IS_OBJECT:
449         case IS_ARRAY:
450                 var_arg->vt = VT_EMPTY;
451                 break;

if IS_OBJECT, should check if it is COM object, and set var_arg->vt as appropriate

John

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

[2000-09-12 12:21:28] [EMAIL PROTECTED]
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:Inetpubwwwrootphpbugado.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.

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


Full Bug description available at: http://bugs.php.net/?id=6683


-- 
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