标题:[求助]i一个不能正确显示分页的代码
只看楼主
zln
Rank: 1
等 级:新手上路
帖 子:73
专家分:0
注 册:2006-1-6
 问题点数:0 回复次数:0 
[求助]i一个不能正确显示分页的代码

请帮忙看看为什么我的分页显示记录代码不能进行分页显示呢?急
<!--#include file="conn.asp"-->

<%dim rs1,ipage
set rs1=server.createobject("adodb.recordset")
sql="select * from tijianjilu"
rs1.open sql,conn,3
rs1.pagesize=1
if request("page")<>""then
ipage=cint(request("page"))
else
ipage=1
end if
response.write("当前第"&ipage&"页")
rs1.absolutepage=ipage
%>
<%dim direct
direct = result
sql = "Select a.*,b.UserName,b.UserSex From tijianjilu a,admininfo b Where a.Tijiandanhao=b.Tijiandanhao and a.Tijiandanhao='"& session("admin")&"'"
set rs = conn.execute(sql)

'//---------------------------------------------------------------------------
If Not rs.eof then

%>

<table width="1253" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="55" height="20" align="center">工资卡号</td>
<td width="54" height="20" align="center">体检年度</td>

<td width="59" height="20" align="center">心脏</td>



</tr>
<%
for i=0 to rs.pagesize-1
if rs.eof or rs.bof then exit for%>

<%do while not rs.eof%>
<tr>
<td width="55" height="20" align="center"><%=rs("Tijiandanhao")%></td>
<td width="54" height="20" align="center"><%=rs("Tijianshijian")%></td>
<td width="59" height="20" align="center"><%=replace(rs("xin")&"",",","")%></td>
<tr>
<% rs.movenext
loop
next
%>

%>
</tr>
</table>
<br>
<%else%>
<table width="4610" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1217" align="center">
<%
Response.Write("没有找到相关记录!!")
%></td>
</tr>
</table>
<br>
<a href="#">第一页</A><A HREF="viewrecord.asp?page=<%=ipage-1%>">上一页</a>
<a href="viewrecord.asp? page=<%=ipage+1%>">下一页</a><a href="#">最后页</a>
<%end if
rs.close
set rs = nothing
conn.close
set conn = nothing
%>

搜索更多相关主题的帖子: sql 记录 request include direct 
2006-06-09 10:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-70820-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.313057 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved