Need assistance Sorting this AP page

Discussion in 'ASP General' started by mwalk66@hotmail.com, Nov 14, 2005.

  1. Guest

    I have been able to create a web based company phone book by retrieving
    the last name, first name, email address and telephone # from active
    directory. However I need serious assistance in modifying the code to
    sort the columns by order of last name then first name for ease of use
    by our user community. Any assistance woudl be much appreciate since I
    am a complete newbie to asp. I have quoted the cide for producing the
    address book as follows:

    <%@ LANGUAGE="VBSCRIPT" %>
    <html>
    <head>
    <meta HTTP-EQUIV="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>Company Address Book</title>
    </head>
    <body style="text-align: center">

    <H1 align="center">Company Address Book</H1>
    <TABLE BORDER="1" style="text-align: center">
    <%
    strDomainDN = " DC=mydomain, DC=com"
    Set objCon = CreateObject("ADODB.Connection")
    objCon.Provider = "ADsDSOObject;"
    objCon.Open "Active Directory Provider"
    Set objRS = objCon.Execute("<LDAP://" & strDomainDN & ">;" &
    "(&(objectCategory=Person)(objectClass=user)(mail=*));" &
    "sn,givenName,telephoneNumber,mail;subtree" )
    objRS.MoveFirst
    Response.write "<tr bgcolor=""#aaaaaa""><td ALIGN=Center><B>" & "Last
    Name" & "</B></td>"
    Response.write "<td ALIGN=Center><B>" & "First Name" & "</B></td>"
    Response.write "<td ALIGN=Center><B>" & "Phone #" & "</B></td>"
    response.write "<td ALIGN=Center><B>" & "E-mail Address" &
    "</B></td></tr>"
    While Not objRS.EOF
    response.write "<td ALIGN=Left>" & objRS.Fields(0).Value & "</td>"
    response.write "<td ALIGN=Left>" & objRS.Fields(1).Value & "</td>"
    response.write "<td ALIGN=Left>" & objRS.Fields(2).Value & "</td>"
    response.write "<td><A HREF=""mailto:" & objRS.Fields(3).Value &
    """>"
    response.write objRS.Fields(3).Value & "</A></td></tr>"
    objRS.MoveNext
    Wend

    Set objRS = Nothing
    Set objCon = Nothing
    %>
    </TABLE>

    </body>
    </html>
    , Nov 14, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB Programmer

    Copy Project Error - Need assistance

    VB Programmer, Jan 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    327
    VB Programmer
    Jan 19, 2004
  2. Luis Esteban Valencia

    Need assistance connecting to AD using LDAP

    Luis Esteban Valencia, Jan 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    379
    Luis Esteban Valencia
    Jan 12, 2005
  3. Joe Ross
    Replies:
    0
    Views:
    583
    Joe Ross
    Aug 30, 2005
  4. =?Utf-8?B?bWFzdGVybWluZA==?=

    Need Assistance: session state error - ASP v1.1 vs ASP v2.0

    =?Utf-8?B?bWFzdGVybWluZA==?=, Dec 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    2,168
    =?Utf-8?B?bWFzdGVybWluZA==?=
    Dec 7, 2005
  5. Big Mike
    Replies:
    2
    Views:
    349
    Phil...
    Oct 2, 2003
Loading...

Share This Page