Hi
Can anyone tell me how i can edit my Code so that it will only display 5 record per page and then add a link at the bottem to list the next 5 records ?
here is what i have got
Code:
<%
pStr = "private, no-cache, must-revalidate"
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", pStr
%>
<head>
<style>
td { font-size : 8pt; font-family : Verdana, Arial; text-decoration : none; }
body { font-size : 8pt; font-family : Verdana, Arial; text-decoration : none; }
</style>
</head>
<body>
<p align="center"><b>All Records Entered :</b></p>
<p align="center"><a href="Burtonshowall.asp">Briggs Of Burton</a> <a href="Bincshowall.asp">Briggs Inc</a><br> <a href="Autoshowall.asp">Briggs Auto</a></p>
<table width=611 height="283" border=0 align="center" cellpadding=3 cellspacing=3 cols=2>
<%
' Declaring variables
Dim rs, data_source, no
no = 0
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\10.0.0.80\phone\employee.mdb"
' Creating Recordset Object and opening the database
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "employees", data_source
' Looping through the records to show all of them
While Not rs.EOF %>
<form action="del.asp" method="post">
<tr>
<td width="296" height=10 align="right" valign="top">First Name :</td>
<td align="left" height=10 valign="top" width=294><%=rs("firstname") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Sur Name </td>
<td align="left" height=10 valign="top"><%=rs("surname") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Department :</td>
<td align="left" height=10 valign="top"><%=rs("Department") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Site :</td>
<td align="left" height=10 valign="top"><%=rs("Site") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Ext :</td>
<td align="left" height=10 valign="top"><%=rs("EXT") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">DDI :</td>
<td align="left" height=10 valign="top"><%=rs("DDI") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Mobile :</td>
<td align="left" height=10 valign="top"><%=rs("Mobile") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Email :</td>
<td align="left" height=10 valign="top"><%=rs("Email") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top"><input type="hidden" name="id" value="<%=rs("id")%>"></td>
<td align="left" height=10 valign="top"><input type="submit" value="Delete" style="height: 25px; width: 100px"></td>
</tr>
<td align="right" height=10 valign="top"><input type="hidden" name="first_name" value="<%=rs("firstname")%>"></td>
<td align="right" height=10 valign="top"><input type="hidden" name="sur_name" value="<%=rs("surname")%>"></td>
</form>
<tr>
<td> </td>
<td> </td></tr>
<%
no = no + 1
rs.MoveNext
Wend
' Done. Now close the Recordset
rs.Close
Set rs = Nothing
%>
<tr>
<td align="right" height=10 valign="top"><b>Total Records Found</b> :</td>
<td align="left" height=10 valign="top"><%= no %></td>
</tr>
</table>
</body>
</html>
James