From:             bodgadle at yahoo dot co dot uk
Operating system: Windows 2000
PHP version:      4.3.3
PHP Bug Type:     COM related
Bug description:  Unable to get IDispatch interface to ado but ACL's all correct and 
it's random

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 bug report at http://bugs.php.net/?id=25285&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25285&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25285&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25285&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25285&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25285&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25285&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25285&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25285&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25285&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25285&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25285&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25285&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25285&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25285&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25285&r=gnused

Reply via email to