How To Use ADO to Access Objects Through an ADSI LDAP Provider
This article was previously published under Q187529 On This PageSUMMARY
The Active Directory Service Interfaces (ADSI) Lightweight
Directory Access Protocol (LDAP) provider implements OLE DB interfaces that
allow you to use ActiveX Data Objects (ADO) to access objects in LDAP
compliant directories. You must create an ADO connection object and set its
Provider property to "ADsDSOObject". You can specify any string, including
"", as the connection string (first argument) of the ADO connection
object's open method.
The connection object Execute method's CommandText (first object) is an LDAP query composed of four elements separated by semicolons, in the following format:
where:
To return the ADsPath, class, and cn attributes of all the objects in all the recipient containers in an Exchange server, you can use the following CommandText (in URL format):
or (in attributed name format):
MORE INFORMATION
The following Visual Basic sample code illustrates this query:
Sample CodeREFERENCES
For a listing and explanation of common LDAP RFCs, including RFC 2253 and RFC 2254, please see the following article in the Microsoft Knowledge Base:
221606 (http://support.microsoft.com/kb/221606/EN-US/) Common LDAP RFCs
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
275917 (http://support.microsoft.com/kb/275917/EN-US/) PRB: ADSI 2.5 and MDAC 2.6 Compatibility Issues
APPLIES TO
| Article Translations
|

Back to the top
