[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:


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 =

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


End Sub

The code stops at:

Set rs =

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.