#33596 [Asn->Fbk]: ADOMD COM works, DCOM doesn't

From: Date: Fri, 19 Aug 2005 11:59:59 +0000
Subject: #33596 [Asn->Fbk]: ADOMD COM works, DCOM doesn't
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83808@lists.php.net to get a copy of this message
ID: 33596 Updated by: wez@php.net Reported By: marko dot sirovnik at korona dot si -Status: Assigned +Status: Feedback Bug Type: COM related Operating System: Windows 2003 Server PHP Version: 5.0.4 Assigned To: wez New Comment: You're supposed to have the vbs echo something to indicate if it worked or not. Previous Comments: ------------------------------------------------------------------------ [2005-08-19 11:47:56] sniper@php.net Wezzie? :) ------------------------------------------------------------------------ [2005-08-19 11:10:26] marko dot sirovnik at korona dot si 1. I put Read & Execute permissions on "cmd.exe" and "cscript.exe". 2. OLAP.VBS ---------------- Dim cat Set cat = CreateObject("ADOMD.Catalog") cat.ActiveConnection = "DATA SOURCE=blackbox;UID=sa;Initial Catalog=FoodMart 2000;Provider=MSOLAP;Encoding=windows-1250;Roles=skrbnik;" 3. COM_VBS.php ------------------- <?php $r = system('cscript.exe c:\OLAP.vbs', $a); echo "Result = " . $a; ?> 4.Result in Browser --------------------- Result = 1 No idea, does it work or does it not. There is no difference in result in Browser concerning of changes the DATA SOURCE parameter in Connection string. Either Local or Remote OLAP server, the result is the same. Did I miss something? ------------------------------------------------------------------------ [2005-08-17 16:53:30] wez@php.net PHP doesn't touch the content of your strings (except to convert to UTF-16); it passes them on to the COM server, and its the COM server that's reporting an error. It seems unlikely that PHP is the cause. Can you try running your .vbs file from the same environment as PHP? eg: Create a PHP page that calls system("cscript.exe test.vbs") and then request that PHP page from your browser. (you will probably need to replace the MsgBox line with Echo) ------------------------------------------------------------------------ [2005-08-17 10:48:42] marko dot sirovnik at korona dot si After some testing and checking securities on both servers I have found out that ADOMD is not meant to be a DCOM object. Namely, in the connection string is written all necessary connection information (server, user, pass, OLAP Cube, etc.). In my case this is stored in variable »$dsn«. Therefore, I have tried to connect to ADOMD COM object locally. In my reproduce code written above I have replaced the following line: $cat = new COM('ADOMD.Catalog', array( "Server" => "blackbox", "Username" => "administrator", "Password" => "default")); with line $cat = new COM('ADOMD.Catalog'); The connection with OLAP is established but the problem comes in the following line: $cat->ActiveConnection = $dsn; Result in Browser: Connection with OLAP has been established. Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft® OLE DB Provider for Analysis Services Description: Property name was not recognized, 'Encoding'' So, communication is OK, only the parameters stored in “$dsn” are “wrong” or they supposed to be wrong. And why this doubt? I have checked the same syntax also with VisualScript code stored in VBS file and works fine with all parameters. Here is the testing example: Dim cat Set cat = CreateObject("ADOMD.Catalog") cat.ActiveConnection = "DATA SOURCE=blackbox;UID=sa;Initial Catalog=FoodMart 2000;Provider=MSOLAP;Encoding=windows-1250;Roles=skrbnik;" MsgBox cat.Name My impression is that ADOMD COM object works fine with windows technology (VisualBasic, ASP, etc.) but has problem when is called from PHP. I still suspect that could be a PHP internal problem when using ADOMD COM object. What is your opinion? Could you check this PHP and VBS code by yourself? Thanks, Marko ------------------------------------------------------------------------ [2005-07-08 21:37:48] wez@php.net You have to configure the permissions on that DCOM server to allow the web server to access it. If you do that, you need to consider how it might affect the overall security of your system (say there was a remote eval() bug in something else running on your web server). Since this is a local configuration issue, it's not a bug in PHP, so I'm marking it as bogus. You need to read up on DCOM security and configuration to resolve your problem. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33596 -- Edit this bug report at http://bugs.php.net/?id=33596&edit=1

« previous php.bugs (#83808) next »