整段代码如下,问题就是当点击翻页的连接后,翻页那段就没了,红色那段就是负责这个效果,可是怎么看也没问题呀,是不是还要加段什么判断之类的,数据库里的记录数是18条,大家帮忙看看是哪里不对,先谢谢了^_^~~
<%
dim rs,sql,sconn
dim page,i
const spagesize=5
sconn="driver={sql server};server=(local);uid=sa;pwd=13414063034;database=企业销售管理系统;"
page=request.querystring("page")
if page<=0 or page="" then
page=1
end if
set rs=server.createobject("adodb.recordset")
rs.activeconnection=sconn
sql="select * from 职工 order by 职工ID"
rs.open sql,,1,1
if not rs.eof then
rs.pagesize=spagesize
rs.absolutepage=page
i=1
%>
<fieldset style="width:700;align:center;">
<legend>职工表</legend>
<table width="600" border=0 cellpadding="4" align="center">
<tr>
<th>职工ID</th>
<th>职工号</th>
<th>仓库号</th>
<th>姓名</th>
<th>性别</th>
<th>工资</th>
</tr>
<%
do while not rs.eof and i<=spagesize
response.write "<tr><td>"&rs("职工ID")&"</td><td>"&rs("职工号")&"</td><td>"&rs("仓库号")&"</td><td>"&rs("姓名")&"</td><td>"&rs("性别")&"</td><td>"&rs("工资")&"</td></tr>"
rs.movenext
i=i+1
loop
if rs.pagecount>1 then
response.write "<tr><td colspan='6' align='right'>"
if page=1 then
response.write "<a href='fenye1.asp?page="&page+1&"'>下一页</a> "
response.write "<a href='fenye1.asp?page="&rs.pagecount&"'>最后页</a> "
end if
if page=rs.pagecount then
response.write "<a href='fenye1.asp?page="&page-1&"'>上一页</a> "
response.write "<a href='fenye1.asp?page=1'>最前页</a> "
end if
if (page>1) and (page<rs.pagecount) then
response.write "<a href='fenye1.asp?page=1'>最前页</a> "
response.write "<a href='fenye1.asp?page="&page-1&"'>上一页</a> "
response.write "<a href='fenye1.asp?page="&page+1&"'>下一页</a> "
response.write "<a href='fenye1.asp?page="&rs.pagecount&"'>最后页</a> "
end if
response.write "当前为第<font color=red>"&page&"页/共"&rs.pagecount&"页"
response.write "</td></tr>"
end if
%>
</table>
</fieldset>
<%else%>
<center><font size="5" color="#ff0000">对不起,表中还没有记录</font></center>
<%
end if
rs.close
set rs=nothing
%>
[此贴子已经被作者于2007-8-19 15:21:41编辑过]