ID:               25285
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bodgadle at yahoo dot co dot uk
-Status:           Open
+Status:           Wont fix
 Bug Type:         COM related
 Operating System: Windows 2000
 PHP Version:      4.3.3
 New Comment:

The com extension has been completely rewritten in PHP5 and the PHP4
com extension is no longer being maintained. If you find bugs with the
com extension in PHP5 please report them.




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

[2003-08-28 03:01:19] bodgadle at yahoo dot co dot uk

Description:
------------
Just upgraded to 4.3.3 last night and noticing some errors in my php
log file. Now this is not related to ACL's on the machine as that has
been setup correctly, there are no errors in the windows event viewer
either. And even weirder is that the code works fine for a few hours
and then just suddenly i get the above errors everytime i try to access
our database using ADO. A full restart of apache fixes it but until
that's done our site doesnt show any data.

The exact error is

[28-Aug-2003 02:51:00] PHP Warning:  (null)(): Unable to obtain
IDispatch interface for CLSID {00000514-0000-0010-8000-00AA006D2EA4}:
CoInitialize has not been called.  in E:\www\reports\monitoring.php on
line 4


Here's 2 examples of code it happens a lot in

$query = "SET NOCOUNT ON;DELETE T_ARTICLE_LINKS WHERE
AL_ID=".$linkID.";SELECT @@ROWCOUNT AS ROWS";
                $result = 0;
                $conn = new
COM("ADODB.Connection");$conn->CommandTimeout=0;$conn->ConnectionTimeout=0;
                @$conn->Open($_ENV["OUR_CONN"]);
                if ($conn->state == 1) {
                        $rs = $conn->Execute($query);
                        
$rows=$rs->Fields[0]->Value;$rs->Close();$rs->Release();$rs=null;unset($rs);
                        $conn->Close();
                        $conn->Release();$conn=null;unset($conn);
                }
                return $rows;



and here's an example using a stored procedure

$conn = new
COM("ADODB.Connection");$conn->CommandTimeout=0;$conn->ConnectionTimeout=0;
                @$conn->Open($_ENV["NUSONLINE_CONN"]);
                if ($type != '') {
                        $t_id = ($typeID != '') ? $typeID : 0;

                        $cmd = new COM("ADODB.Command");
                        $cmd->ActiveConnection = $conn;
                        $cmd->CommandType = 4;
                        $cmd->CommandText = "proc_POSTER_TYPES";

                        
$cmd->Parameters->Append($cmd->CreateParameter("@RETURN_VALUE", 3,
4, 0, ($RETURN_VALUE=0)));
                        $cmd->Parameters->Append($cmd->CreateParameter("@typeid", 131, 
3, 0,
$t_id));
                        $cmd->Parameters->Append($cmd->CreateParameter("@name", 200, 
1, 1,
stripslashes($typeName)));
                        $cmd->Parameters->Append($cmd->CreateParameter("@successflag", 
131,
3, 0, $successflag));

                        $cmd->Parameters["@typeid"]->Precision = 18;
                        $cmd->Parameters["@successflag"]->Precision = 18;

                        $cmd->Execute();

                        $typeid = $cmd->Parameters["@typeid"]->Value;
                        $successflag = $cmd->Parameters["@successflag"]->Value;
                        $conn->Close();
                        $cmd->Release();$cmd=null;unset($cmd);
                        $conn->Release();$conn=null;unset($conn);

                }



again the errors arent to do with the SQL/SP's used as they happen on
the creation of the COM object.



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


-- 
Edit this bug report at http://bugs.php.net/?id=25285&edit=1

Reply via email to