|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-25 21:34 UTC] steven dot partridge at l-3com dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 23:00:02 2025 UTC |
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}