USE OF ADO TO ACCESS OBJECT THRU AN ADSI LDAP PROVIDER

G

Guest

I'm using the following function in a microsoft access 97 mdb:

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://server/o=myserver01/ou=site/cn=recipients>;" _
& "(objectClass=*);ADsPath,objectClass,cn;subtree")

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

conn.Close

When I try to run the function from the debug window I receive
the following error message: Type Mismatch.

Does anyone has any idea why I'm getting this error message? TIA.
 
G

Guest

Sorry I was using a function instead of a subroutine, but now
I'm getting the following error:

run time error:

Table does not exists at
Set rs = conn.Execute( _
"<LDAP://server/o=myserver01/ou=mylocation/cn=recipients>;" _
& "(objectClass=*);ADsPath,objectClass,cn;subtree")

p.s. this is the first time that I'm trying to access thru an ADSI LDAP
provider.
thanks
 
D

Douglas J Steele

It that's a literal cut-and-paste, I believe it should be ou=myserver01, not
o=myserver01
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top