php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40227 COM object issues with ADODB accessing Active Directory
Submitted: 2007-01-24 23:36 UTC Modified: 2007-01-25 21:34 UTC
From: steven dot partridge at l-3com dot com Assigned:
Status: Not a bug Package: COM related
PHP Version: 5CVS-2007-01-24 (snap) OS: Windows 2003 Server SP1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: steven dot partridge at l-3com dot com
New email:
PHP Version: OS:

 

 [2007-01-24 23:36 UTC] steven dot partridge at l-3com dot com
Description:
------------
I have ported code from VBScript to PHP using the ADODB COM object to access and retrieve information from Active Directory. The code works well in VBScript, but when I run it via PHP I recieve the following error:

exception 'com_exception' with message 'Source: Provider
Description: Table does not exist.' in C:\Inetpub\wwwroot\z_ADODB_test.php:41 Stack trace: #0 C:\Inetpub\wwwroot\z_ADODB_test.php(41): unknown() #1 {main}

I can provide the VBScript if necessary

Reproduce code:
---------------
$objConnection = new COM("ADODB.Connection");
$objCommand = new COM("ADODB.Command");
$objConnection->Provider = "ADsDSOOBject";
$objConnection->Open ("Active Directory Provider");
$objCommand->ActiveConnection = $objConnection;

$objRecordset = new COM("ADODB.Recordset");

$strDNSDomain = "DC=IPS,DC=ad,DC=local";
$strFilter = "(&(objectCategory=person)(objectClass=user)(sAMAccountName=username))";
$strQuery = "<LDAP://".$strDNSDomain.">;".$strFilter.";sAMAccountName,distinguishedName,mail;subtree";

$objCommand->CommandText = $strQuery;

try{
$objRecordset = $objCommand->Execute;
}
catch (com_exception $e) {
  print "<P><B>Error executing ADODB query</B><BR>".$e . "\n";
}

Expected result:
----------------
No errors recieved.

Actual result:
--------------
exception 'com_exception' with message 'Source: Provider
Description: Table does not exist.' in C:\Inetpub\wwwroot\z_ADODB_test.php:41 Stack trace: #0 C:\Inetpub\wwwroot\z_ADODB_test.php(41): unknown() #1 {main}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-25 21:34 UTC] steven dot partridge at l-3com dot com
Ran the similar (slightly modified) code under the CLI php. It ran fine. copied that code into a web page and recieved the same "Table does not exist" error.

At this point I believe it is a permissions error within IIS 6. If anyone has any suggestions I'm more than open to them (please email me).

I've changed this to bogus. Sorry for taking your time.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC