Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ADSI,LDAP, ADO and returning Data

0 views
Skip to first unread message

Aaron Kaufman

unread,
Jun 21, 2001, 12:27:48 PM6/21/01
to
I am attaching to my P&M database using ADO and ADSI (see
code below) in an ASP Page. This code allows me to attach
to the P&M DB, allows me to return the ADsPath, but does
not return any of the other data. IF I try and return sn
and cn I get a type mismatch error. My end goal is to
return FirstName, LastName, Company and Userid and then be
able to sort any of the 4. I think this is a security
issue with the way ADSI works with MDAC, ie, MDAC will not
allow secure connections to ADSI via ADO. Does anyone
have any thoughts on the subject.

query = "SELECT adspath,firstname,sn,cn,companyname
FROM 'LDAP://IPAddress:PORT/o=MTCentral/ou=members' WHERE
cn='*' order by adspath"
set obj_connection = Server.createObject
("ADODB.Connection")
obj_connection.Provider = "ADsDSOObject"
obj_connection.open "Active Directory
Provider", "cn=administrator,ou=members,o=mtcentral", "pass
word"

set obj_command = Server.CreateObject("ADODB.Command")
obj_command.ActiveConnection = obj_connection
obj_command.CommandText = query
set obj_rs = obj_command.execute

do while not obj_rs.eof
response.write obj_rs("adspath") & " " & obj_rs
("firstname") &"<br>"
obj_rs.movenext
loop


Thanks
Aaron

Björn Jansson

unread,
Jun 25, 2001, 2:48:14 AM6/25/01
to
The name could be an array. Try:
response.write obj_rs("adspath") & " " & Join(obj_rs("firstname")) &"<br>"

Björn Jansson


"Aaron Kaufman" <aa...@ajkc.com> skrev i meddelandet
news:11c301c0fa6f$1bc0ade0$b1e62ecf@tkmsftngxa04...

0 new messages