[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Search OpenLDAP with Microsoft ADSI
Hello,
I wrote a simple VB program to search our LDAP server (OpenLDAP 1.2.7 on
Solaris 2.6) :
'*********************************************
Dim con As New Connection
Dim rs As New Recordset
Set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Open "Active Directory Provider", "UID=101,dc=mydomain,dc=edu,dc=hk", "password"
Set rs = con.Execute("LDAP://myldapsever.edu.hk/dc=mydomain,dc=edu,dc=hk;(objectclass=testPerson);cn;SubTree")
...
'*********************************************
However, the program fails with automation error.
If I use ldapsearch from OpenLDAP, I'll get debug output like this:
==> ldbm_back_bind: dn: UID=101,DC=MYDOMAIN,DC=EDU,DC=HK
SRCH "DC=MYDOMAIN,DC=EDU,DC=HK" 2 0 0 0 0
filter: (objectclass=TESTPERSON)
attrs: cn
while the aforementioned VB program gives following debug output :
==> ldbm_back_bind: dn: UID=101,DC=MYDOMAIN,DC=EDU,DC=HK
SRCH "DC=MYDOMAIN,DC=EDU,DC=HK,(OBJECTCLASS=TESTPERSON),CN,SUBTREE" 0 0 0 0 0
filter: (objectclass=*)
attrs: objectclass
All the SRCH command, filter, and attributes are incorrect in the VB case.
I wonder if there's anything wrong in the ADO command.
Would anyone please help ?
Thanks a lot.
Regards,
ST Wong
--
S.T. Wong | Email: st-wong@cuhk.edu.hk