Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying LDAP returns empty recordset.

Status
Not open for further replies.

ygelman

IS-IT--Management
Dec 16, 2002
60
US
Hello forum.

Something strange happens with my web server.
I'm trying to use ADSI to extract user information from LDAP.

Web server that I'm using is - of course IIS installed on Win2k. As well I installed the ADSI from the disk. And promoted the machine to be AD server( after thet I verified that GlobalCatalog is set on that machine).

Then I'm trying to extract the information from LDAP to asp page using ADO.
Here is the snippet of what is going on:

***********************************************************
<%


Set adsiConnection = CreateObject(&quot;ADODB.Connection&quot;)
adsiConnection.Open = &quot;Provider=ADsDSOObject&quot;

Set adsiCommand = CreateObject(&quot;ADODB.Command&quot;)
Set adsiCommand.ActiveConnection = adsiConnection
adsiCommand.CommandText = &quot; SELECT ADsPath, cn FROM 'LDAP://DC=DOMAIN' WHERE cn='Administrator'&quot;

Set adsiRecords = adsiCommand.Execute
'adsiRecords.MoveFirst
Do While Not adsiRecords.EOF
For i=0 To adsiRecords.Fields.Count - 1
Response.Write(adsiRecords.Fields(i).Value)
Next
adsiRecords.MoveNext
Response.Write(&quot;<br>&quot;)
Loop
%>

For some stupid reason - I'm getting the empty page.

Please help - I'spent 3 days on trying to get results.

Thanks,
Yuri.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top