4th Post - AdO Connection to LDAP Directories

Results 1 to 2 of 2

Thread: 4th Post - AdO Connection to LDAP Directories

  1. #1
    Mark Guest

    Default 4th Post - AdO Connection to LDAP Directories

    I am having difficulties connecting to an LDAP (Lightweight Directory Access Protocol) Directory, and creating a recordset using ADO. I am using the Microsoft ADSI LDAP Provider (ADSDSOObject).<BR><BR>Anyone know of any good links that explain the proper LDAP commands for filtering the directory?<BR><BR>As I understand it, these LDAP commands are to an LDAP Directory, like SQL commands are to an ODBC Database.<BR><BR>My problematic code is as follows:<BR><BR>&#039---Create connection object------------------------------<BR>Dim objConnection<BR>Set objConnection = Server.CreateObject("ADODB.Connection")<BR>objConn ection.Provider = "ADSDSOObject"<BR>objConnection.Open "ADs Provider"<BR><BR>&#039---Create recordset object-------------------------------<BR>Dim rsLDAP<BR>Set rsLDAP = Server.CreateObject("ADODB.Recordset")<BR><BR>Set rsLDAP = objConnection.Execute("&#060;LDAP://ldap.serv.com/o=MyCompany.com/ou=Employees&#062;; ????")<BR><BR>While Not rsLDAP.EOF<BR>Debug.Print rsLDAP.Fields(uid).Value, rsLDAP.Fields(First Name).Value, rsLDAP.Fields(Last Name).Value<BR>rsLDAP.MoveNext<BR>Wend<BR><BR>&#03 9------Close & Cleanup Objects----------------------------------- <BR>rsLDAP.Close<BR>Set rsLDAP = NOTHING<BR><BR>objConnection.Close<BR>Set objConnection = NOTHING<BR><BR><BR>Thanks! <BR><BR>--------------------------------------------------------------------------------<BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: 4th Post - AdO Connection to LDAP Directorie

    I have found a couple of really good info sources on LDAP and ADSI for use with File Sytem Objects. The first is the Microsoft Reference and the second is a good ASP Site.http://www.microsoft.com/windows2000...econds.comHere just click the ADSI Link at the top of the page and that should take you where you need to go.
    Arizona Medical Marijuana
    Last edited by Jay; 04-16-2011 at 01:34 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts