[原创]那位看看分页显示那里写的不对了
下面是一段我写的分页显示代码看看那里不对了<%
pagesize=10 '设定每一页所显示的人数为10
set conn=server.CreateObject("ADODB.connection")
set rs=server.CreateObject("ADODB.recordset")
sql="select * from student order by desc"
conn.open"edu"
rs.open sql,conn,1,1
if rs.recordcount=0 then
response.Write"<p><center>对不起,没有相关的信息!</center></p>"
else
rs.pagesize=cint(pagesize)'设定pagesize属性的
rs.absolutepage=pageno
response.Write"<center>"
position=rs.pagesize*pageno+1
if position<rs.recordcount then
pagend=position
else
pagend=rs.reacordcount
end if
response.Write"<p><font color='navy'><b>学生列表</b></p>"
response.write"<p>(共有"&RS.RecordCount &"名学生) </p>"
Response.Write "< TABLE WIDTH=800 BORDER=1 CELLPADDING=4 CELLSPACING=0 BGCOLOR=#00FFFF>"
response.write"<tr bgcolor=#5FB5E2><font size=2><td><b>学生号</b></td><td><b>姓名</b></td><td><b>密码</b></td><td><b>籍贯</b></td><td><b>系别</b></td><td><b>性别</b></td><td><b>学分</b></td><td><b>电话</b></td><td><B>E_mail<B></TD><TD><B>管理操作1</b></td><td><b>管理操作2</b></td></font></tr>"
do while not (rs is nothing)
rowcount=rs.pagesize
do while not rs.eof and rowcount >0
if n=1 then
Response.Write "< TR BGCOLOR=#FFFFFF>"
ELSE
Response.Write "< TR BGCOLOR=#EEEEEE>"
End If
n=1-n %>
<td> <% =RS("id")%> </td>
<td> <% =rs("name")%> </td>
<td> <% =rs("password")%> </td>
<td> <% =rs("jiguan")%> </td>
<td> <% =rs("department")%></td>
<td> <% =rs("sex")%> </td>
<td> <% =rs("mark")%></td>
<td> <% =rs("tel")%></td>
<td> <% =rs("e_mail")%></td>
<td><a href='change.asp? key=< % =RS("ID")%>'>修改</a></td>
<td><a href='del.asp? key=< % =RS("ID")%>'>删除</a></td>
</tr>
<%
RowCount = RowCount - 1
RS.MoveNext
Loop
set RS = RS.NextRecordSet
Loop
Conn.Close
set rs = nothing
set Conn = nothing
%>
</TABLE>
<% If iPageCurrent <> 1 Then
%>
<%
'#####下一句的page.asp与本文件名字相同,即全部是page.asp######
%>
<A HREF="page.asp?page=<%= abslutepage - 1 %>&order=DESC">上一页</A>
<%
End If
If abslutepage < PageCount Then
%>
<%
'##########下一句的page.asp与本文件名字相同,即全部是page.asp##########
%>
<A HREF="page.asp?page=<%= abslutepage + 1 %>&order=DESC %>">下一页</A>
<a href="add.asp">添加</a>
<%
End If
%>