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

ASP Slow to Display Data 2

Status
Not open for further replies.

MISdad

Technical User
May 5, 2004
34
0
0
I've got an ASP page that lists employee phone numbers. It is pulling the information from our employee database and displaying it in a web page on our intranet server. The database server is running IBM DB2 and I have a view created to get the information from the individual tables. The problem is that is seems to take a long time (around 20 seconds) to display the list. We only have around 500 employees and I have the page set to list them alphabetically by department and division. It just doesn't seem like it should take that long to load and since I'm new to this I'm wondering if something in my code is causing the problem - too bulky maybe. Any suggestions are greatly appreciated. Here is the code (sorry it's kind of long).

Code:
<% Response.Buffer = True %>

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">

<title>Employee Phone List</title>
</head>
<body>

<div align="center">
  <center>

<table border="0" width="550" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
  <tr>
    <td><p align="center"><a name="top"></a><font color="#800000"><big>EMPLOYEE TELEPHONE DIRECTORY<br>
    LISTED BY DEPARTMENT AND DIVISION</big></font></p>
    <p align="center">
    <img src="../phone.jpg" alt="phone.jpg (2384 bytes)"></p>
    <p align="left">&nbsp;</td>
  </tr>
</table>
  </center>
</div>

<p align="center"><b><font face="helvetica,arial">
<a href="#D1">Department1</a></font></b><font FACE="helvetica,arial"><b>&nbsp; 
<a href="#D2">Department2</a>&nbsp;
<a href="#D3">Department3</a>&nbsp; 
<a href="#D4">Department4</a>&nbsp; <br>
<a href="#D5">Department5</a>&nbsp; 
<a href="#D6">Department6</a>&nbsp;
<a href="#D7">Department7</a>&nbsp; 
<a href="#D8">Department8</a>&nbsp;
<a href="#D9">Department9</a></b></font><br>
&nbsp;</p>


<%
Dim MyConn
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=PHONE_LIST"
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")%>

    <p align="left"><u><b><font face="Arial" color="#000080"><a name="#D1"> Department1</a></font></b></u>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
   <tr>
    <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
    <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
    <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
    <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	</table>
	
	<%rs.Open "SELECT * FROM EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department1' AND  EMPLOYEE_PHONES.Division_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DIVISION_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
	<br>
	<%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department1' AND  EMPLOYEE_PHONES.Division_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DIVISION_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
    <br>
	<%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department1' AND  EMPLOYEE_PHONES.Division_DESC=' DivisionName ' ORDER BY  EMPLOYEE_PHONES.DIVISION_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
	<br>
	<%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department1' AND  EMPLOYEE_PHONES.Division_DESC=' DivisionName ' ORDER BY  EMPLOYEE_PHONES.DIVISION_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
	<br>
	<%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department1' AND  EMPLOYEE_PHONES.Division_DESC=' DivisionName' ORDER BY  EMPLOYEE_PHONES.DIVISION_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
	<br>
	<%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department1' AND  EMPLOYEE_PHONES.Division_DESC=' DivisionName' ORDER BY  EMPLOYEE_PHONES.DIVISION_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>	
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
    
    
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D2"> Department2</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department2' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department2' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
	  <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC='Municipal Services' AND  EMPLOYEE_PHONES.DIVISION_DESC='Engineering' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC='Traffic and Parking' AND  EMPLOYEE_PHONES.DIVISION_DESC='Engineering' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>	
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
    
    
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D3"> Department3</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC='Department3' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
    

<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D4"> Department4</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department4' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department4' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department4' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
      
      
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D5"> Department5</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department5' AND EMPLOYEE_PHONES.DIVISION_DESC = 'DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department5' AND  EMPLOYEE_PHONES.DIVISION_DESC = 'DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
    
    
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D6"> Department6</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department6' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
   <p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
   <br> 
   
   
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D7"> Department7</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department7' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department7' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
     <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department7' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
     <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department7' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
    
    
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D8"> Department8</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department8' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department8' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department8' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department8' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department8' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
    <br>
    
    
<p align="left"><u><b><font face="Arial" color="#000080"><a name="#D9"> Department9</a></font></b></u>    
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
       <tr>
        <td width="23%"><font face="Arial" size="2"><b><%Response.Write "NAME"%></b></font></td>
        <td width="11%"><font face="Arial" size="2"><b><%Response.Write "PHONE"%></b></font></td>
        <td width="29%"><font face="Arial" size="2"><b><%Response.Write "DIVISION"%></b></font></td>
        <td width="37%"><font face="Arial" size="2"><b><%Response.Write "JOB TITLE"%></b></font></td></tr>
	  </table>
      <%Set rs = Server.CreateObject ("ADODB.Recordset")
      rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department9' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department9' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
      <%rs.Open "SELECT * FROM  EMPLOYEE_PHONES WHERE  EMPLOYEE_PHONES.PHONE_DESC='OFFICE' AND  EMPLOYEE_PHONES.DEPARTMENT_DESC=' Department9' AND  EMPLOYEE_PHONES.DIVISION_DESC='DivisionName' ORDER BY  EMPLOYEE_PHONES.DEPARTMENT_DESC,  EMPLOYEE_PHONES.LASTNAME", MyConn
	  While NOT rs.EOF%>
	    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
         <tr>
          <td width="23%"><font face="Arial" size="2"><%Response.Write rs("LASTNAME") & ", " & rs("FIRSTNAME")%></font></td>
          <td width="11%"><font face="Arial" size="2"><%Response.Write mid(rs("PHONE_EMAIL"), 4, 3) & " - " & right(rs("PHONE_EMAIL"), 4)%></font></td>
          <td width="29%"><font face="Arial" size="2"><%Response.Write Ucase(rs("DIVISION_DESC"))%></font></td>
          <td width="37%"><font face="Arial" size="2"><%Response.Write rs("JOB_TITLE_DESC")%></font></td>
         </tr>
        </table>
	  <%rs.MoveNext
	  Wend
      rs.Close%>
      <br>
	<p align="center"><font face="Arial" size="2"><a href="#top">Back to the Top of the Page</a></font></p>
      
    <%Set rs = Nothing
    MyConn.Close
    Set MyConn = Nothing%>
    
</body>
</html>
 
your whole code should look like this:

Code:
<html>
<body>
<%
'declare variables
dim rs, conn, sql

'set all our objects
set rs=server.createobject("adodb.recordset")
set conn=server.createobject("adodb.connection")

'open connection string
conn.open "your connectionstring here"
'write our sql statement
sql = "your sql string here"

rs.open sql, conn

IF rs.EOF AND rs.BOF then
response.write "sorry, no records found"
else
%> 

<table border="1", cellspacing="1", cellpadding="1">
<tr>
 
<th>Product ID</th>
<th>Product Name</th>
<th>Description</th>
<th>Vendor Name</th>
<th>Contact Information</th>

<% 
do until rs.EOF
%> 
<tr>

<td align="center"><font size="2" face="verdana"><%=rs("ProductId")%></td>
<td align="center"><font size="2" face="verdana"><%=rs("ProductName")%></td>
<td align="center"><font size="2" face="verdana"><%=rs("ProductDesc")%></td>
<td align="center"><font size="2" face="verdana"><%=rs("VendorName")%></td>
<td align="center"><font size="2" face="verdana"><%=rs("ContactInfo")%></td>
<%
rs.movenext
loop

    End If
rs.close
set rs=nothing
con.close
set con=nothing

%>
</table>


</body>

</html>


%>


of course it is just a sample...so change the variable and field names...
 
Thanks for the feedback. I've tried the suggested code and it works fine (much faster too) but what I'm trying to do is have the page look something like this:

1st Department Name (as a heading)
NAME PHONE DIVISION JOB TITLE (Columns)

(--Blank lines for a break--)

2nd Department Name (as a heading)
NAME PHONE DIVISION JOB TITLE (Columns)


Etc., etc. In other words, I want the list to be divided by Department and then sorted by Division and Name under each Department. I'm not looking to just have a long list of all the employees displayed in a table. The sorting is working fine but I'm not having much luck figuring out how to display the page broken up in different sections.
 
thats pretty easy...here is how you do it...i will just provide the logic...and it should be very easy for you to implement it...

Code:
<html>
<body>
<%
    Dim sql, rs, conn

    Set rs = Server.CreateObject("ADODB.Recordset")
    Set conn = Server.CreateObject("ADODB.Connection")
        conn.open "your connection string"
sql =" Your sql string"    
rs.Open sql, conn

Do While Not rsObj.eof%> 


tempdepartment=rs("department")%>

[red][b]<STYLE="page-break-after: always">[/b][/red]

<table border="1">
<tr>
    <th>MY Field1</th>
    <th>MY Field2</th>
    <th>MY Field3</th>
  </tr>


<%do until rsObj.eof%>
<tr>
<td><%=rs("myfield1")%></td>
<td><%=rs("myfield2")%></td>
<td><%=rs("myfield3")%></td>
  </tr>
rs.movenext
  
If tempdepartment<>rs("department") Then exit Do  
loop
loop

End If
%>

</table>
</body>
</html>
now you see that red line...that will break the page after the end of each department listing...

post back if you have any questions...

-DNG
 
Request all of your departments at once, ordering by department (and then sub-ordering however you want). Then you'll effectively do this:
Code:
strCurrentDept = ""

...

Do While Not rsObj.eof
    If rsObj("DeptName") <> strCurrentDept Then
        'Print your page break
        'Print your header
        strCurrentDept = rsObj("DeptName")
    End If

    'Print your regular line

Loop
That way you only have one recordset, one connection.

And to save even more time, look into using GetRows for your recordset, the way the cool kids do it. :)
 
This is working great now. Thanks to everyone for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top