do while与for循环的区别
这里我用for循环页面就出现错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/人才招聘系统asp.0602/page.asp
而用Do while 循环就能实现分页功能
<!--#include file="Conn.asp" -->
<!--#include file="Comm/Site_Class.asp" -->
<%
PagePath = ""
Set Qsite = New Site_Class
Qsite.SiteConfig_Master()
%>
<%
Dim Rs,Sql,i,CurrentPage,FileName,j
Dim PersonName,ViewType
Dim PerId
Dim Act,IsHidden,IsLock,IsGj,IsTj,IsYear,IsSh
Dim TodayDate
Set Rs = server.CreateObject("ADODB.recordset")
%>
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>简历管理</title>
<link href="../skins/css/main.css" rel="stylesheet" type="text/css">
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
<tr>
<td width="8%" class="td_content"><strong>用户名</strong></td>
<td width="8%" class="td_content"><strong>真实姓名</strong></td>
<td width="6%" class="td_content"><strong>性别</strong></td>
<td width="6%" class="td_content"><strong>年龄</strong></td>
<td width="8%" class="td_content"><strong>学历</strong></td>
<td width="12%" class="td_content"><strong>求职意向</strong></td>
</tr>
<%
Rs.Open "select * from PersonTbl order by EditDate desc", Conn , 1 , 1
If Rs.Eof Then
%>
<tr>
<td height="45" colspan="11" class="td_content">暂无简历信息</td>
</tr>
<%
Else
CurrentPage=Clng(Request("page"))
Rs.PageSize=15
if CurrentPage="" Then CurrentPage=1
if isNumeric(CurrentPage) Then CurrentPage=int(CurrentPage)
if CurrentPage<1 Then CurrentPage=1
if CurrentPage>rs.pagecount Then
CurrentPage=rs.pagecount
End if
if CurrentPage<=rs.pagecount and rs.pagecount>0 Then
rs.absolutepage=CurrentPage
End if
i = 0
if not rs.Eof Then ------------
for j=1 to rs.recordcount-----------改为DO While not rs.Eof
%>
<tr>
<td class="td_content"><%=Rs("UserName")%></td>
<td class="td_content"><%=Rs("RealName")%></a></td>
<td class="td_content"><%=Rs("Sex")%></td>
<td class="td_content"><%=Rs("Age")%></td>
<td class="td_content"><%=Rs("Qualification")%></td>
<td class="td_content"><%=Rs("JobPost")%></td>
<%
i = i + 1
response.Write(i)
response.Write(j)
response.Write("<br>")
Rs.MoveNext
If i >= Rs.PageSize Then Exit For-------For 改为Do
next------------------------------------Loop
End if
End If
%>
</table>
<%If Rs.pagecount>1 Then%>
<% If CurrentPage > 1 Then %>
<a href="page.asp?page=<%=CurrentPage-1%>">前一页</a>
<% Else %>
首页 上页
<% End if%>
<% If CurrentPage < Rs.pagecount Then %>
<a href="page.asp?page=<%=CurrentPage+1%>">后一页</a>
<% End if%>
<a href="page.asp?page=<%=rs.pagecount%>">末页</a>
<% End if%>
</p>
<p align="center">现在是第<%=CurrentPage%>页一共有<%=rs.pagecount%>页</p>
<%
Rs.Close
%>
</body>
</html>