谁能靠诉我为什么输不出第二页以后的内容?

lqhlqh 2003-11-04 01:59:46
分页时,没有显示错,但就是输不出第二页以后的内容!现在附上原码!望各位大侠指点指点!小女子先谢了!



<!-- #include file=conn.asp-->
<%
if not isempty(request("page")) then
currentpage=cint(request("page"))
else
currpage=1
end if
page=request.querystring("page")
if page>totalpage then
page=1
end if
if page<1 or page="" or not(isnumeric(page)) then
page=1
end if
dim rs,sql,i
sql="select * from liu "
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,3
if rs.eof then
else
rs.pagesize=7
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
rs.cachesize=rs.pagesize
end if
for i=1 to rs.pagecount
response.Write "<A href='index.asp?page="&i&"'>"&_
"第"&i&"页"&"</a>"&" : : :"
next

%>



<%
for i=1 to rs.PageSize
if rs.EOF then
exit for
end if
%>


<table width="760" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="183"><%=rs("name")%> </td>
<td width="163"><a href="love.asp?id=<%=rs("id")%>" >
<%

if len(rs("count"))>10 then
dim string
string=rs("count")
response.write left(string,10)&"..."
else
response.write rs("count")
end if

%>
</a></td>
<td width="194">    <a href="modify1.asp?id=<%=rs("id")%>">修改</a></td>
<td width="105">  <a href="delet.asp?id=<%=rs("id")%>">删除</a></td>
<td width="105"><%=rs.recordcount%></td>
</tr>
</table>
<%
rs.movenext
next

%>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="right">共<%=totalpage%>/<font color=red><%=page%></font>页
<%if page>1 then%>
<a href="index.asp?page=1">首页</a>
<%else%>
<font color=666666>首页</font>
<%end if%>
<%if page-1>0 then%>
<font color=666666><a href="index.asp?page=<%=page-1%>">上页</a>
<%else%>
<font color=666666>上页</font>
<%end if%>
<%if page+1<=totalpage then%>
<a href="index.asp?page=<%=page+1%>">下页</a>
<%else%>
<font color=666666>下页</font>
<%end if%>
<%if page<totalpage then%>
<font color="#000000"><a href="index.asp?page=<%=totalpage%>">末页</a></font>
</font>
<%else%>
<font color=666666>末页</font>
<%end if%>
</div></td>
</tr>
</table>
<%


rs.close
set rs=nothing
sql.close
set sql=nothing
%>
...全文
23 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
DeltaCat 2003-11-04
  • 打赏
  • 举报
回复
<%
if not isempty(request("page")) then
currentpage=cint(request("page"))
else
currpage=1
end if
page=request.querystring("page")
if page>totalpage then
page=1
end if
if page<1 or page="" or not(isnumeric(page)) then
page=1
end if
-------------------------------------------
整理后
--------------------------------------------------

<%
page=request.querystring("page")

if len(page)=0 or not(isnumeric(page)) then
page=1
else
page = Cint(page)
end if
DeltaCat 2003-11-04
  • 打赏
  • 举报
回复
你开头的代码 都在做 无用功 啊
DeltaCat 2003-11-04
  • 打赏
  • 举报
回复
真不愧是女生,代码写的那就叫乱啊 ^_^

rs.open sql,conn,1,1

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧