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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Directory (Using ASP) Selecting otherTelephone fields, not able

Status
Not open for further replies.

olorean

Programmer
Dec 5, 2002
13
0
0
US
I am trying to query Active Directory for information through ASP

I am able to pull up cn, telephoneNumber, and many other fields.

Yet I am not able to pull up otherTelephone.

I read, according to numerous internet documentation, that otherTelephone is only an array element below telephoneNumber. Yet I am still unable to query the field otherTelephone in any format or display the information as an array element of telephoneNumber.

Here is my syntax to display cn, and telephoneNumber:

<%
SQLStmt = &quot;SELECT cn, telephoneNumber FROM 'myLDAP' WHERE objectClass = '*' AND description = 'myCode' ORDER BY cn&quot;

Set Conn = CreateObject(&quot;ADODB.Connection&quot;)
Conn.Provider = &quot;ADSDSOObject&quot;

Conn.Open &quot;ADs Provider&quot;, &quot;&quot;, &quot;&quot;

Set rs = Conn.Execute(SQLStmt)

Do While Not rs.EOF

If Not rs.EOF Then
EName = rs.Fields(&quot;cn&quot;).Value
EPager = rs.Fields(&quot;telephoneNumber&quot;).Value

Response.Write &quot; <tr height=18 style='mso-height-source:userset;height:13.5pt'><td> &quot;

If IsArray(EName) Then
For I = LBound(EName) To UBound(EName)
Response.Write EName(I)
Next
End If

Response.Write &quot; </p></td><td><p align=center>&quot;

If IsArray(EPager) Then
For I = LBound(EPager) To UBound(EPager)
Response.Write EPager(I)
Next
Else
Response.Write &quot; &quot;
End If

Response.Write &quot; </p></td></tr>&quot;

End If

rs.MoveNext

Loop
%>

What do I need to modify to display the next element of
telephoneNumber?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top