[Date Prev][Date Next] [Chronological] [Thread] [Top]

Help on VB or VBScript



I am trying to reach openLDAP with ADSI.
I have this info from Microsoft:

http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q187529

And here is my VB code:

---------------------------------------
Private Sub run_Click()

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

Set conn = New ADODB.Connection
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"

Set rs =
conn.Execute("<LDAP://hefesto.mcnet.pt:7030/r=Santander>;(objectClass=*);id;
subtree")

While Not rs.EOF
    Debug.Print rs.Fields(0).Value, rs.Fields(1).Value, rs.Fields(2).Value
    rs.MoveNext
Wend

conn.Close

End Sub
---------------------------------------

The code stops at:

Set rs =
conn.Execute("<LDAP://hefesto.mcnet.pt:7030/r=Santander>;(objectClass=*);id;subtree")

with the error:

---------------------------------------
Run-time error '-2147467259(800004005)':

Unspecified error
---------------------------------------

I can query the LDAP server with other APIs (JNDI for example) with no problem.
I have very little information on the ldap server, just enough to do some testing and it does not work.
 
Also, it seems that replacing id with any attribute on the core.schema file makes this work.
So, if I have defined another schema file I will not be able to access the information it defines. :(

This code is the one sugested by Microsoft and... nothing.
Any help is welcome.
If possible, please email direct to joao.lopes@santander.pt
Thank you.

John