asp 复杂表格的分页问题
一个复杂的嵌套表格,现在要分页,每页显示6条数据,数据已经正确读取,可是分页的时候第二页也是显示的第一页的数据,请高手帮忙~~<%dim bc,jh,ssjj
'response.Write(request.form("sj"))&"\\\\\\\\"
ssjj=request("WS_Officesj")
Set rs0 = Server.CreateObject("ADODB.Recordset")
sql="select * from cyrbb where WS_Officesj='"&ssjj&"' order by id asc"
rs0.open sql,Conn,3,3
'response.Write(rs("jh"))
'rs.movenext
'response.Write(rs("jh"))
if rs0.bof and rs0.eof then
'response.Write(rs("sj"))&sql
%>
<script language="javascript">
alert("对不起数据库中没有您要生成报表的记录,请选择正确的时间或及时将数据入库之后再生成!")
window.history.go(-1)
</script>
<%else
Set rs = Server.CreateObject("ADODB.Recordset")
sql= "Select * From cyrbb Where ID In (Select Max(ID) From cyrbb Group By jh) and WS_Officesj='"&request("WS_Officesj")&"' order by id asc"
rs.open sql,Conn,3,3
rs.movefirst
jh=rs("jh")
<table border="1" cellpadding="0" cellspacing="0">
<tr height="20">
<td rowspan="5" align="center" height="98" width="72"><p class="STYLE7"><strong>井</strong></p>
<p class="STYLE7"><strong>号</strong></p></td>
<td rowspan="5" align="center" width="72"><p class="STYLE7"><strong>泵径</strong></p>
<p class="STYLE7"><strong>泵深</strong></p>
<p class="STYLE7"><strong>mm/m</strong></p></td>
<td rowspan="5" align="center" width="72"><p class="STYLE7"><strong>冲程</strong></p>
<p class="STYLE7"><strong>冲次</strong></p>
<p class="STYLE7"><strong>m/次</strong></p></td>
<td colspan="6" align="center" width="432"><span class="STYLE7"><strong>生产动态情况反应</strong></span></td>
<td colspan="6" align="center" width="432"><span class="STYLE7"><strong>流 量 计 求 产 记 录</strong></span></td>
<td rowspan="5" align="center" width="72"><span class="STYLE7"><strong>备 注</strong></span></td>
</tr>
<tr height="19">
<td rowspan="4" align="center" height="78" width="72"><p class="STYLE7"><strong>生产</strong></p>
<p class="STYLE7"><strong>时间</strong></p>
<p class="STYLE7"><strong>hmin</strong></p></td>
<td rowspan="4" align="center" width="72"><p class="STYLE7"><strong>观察</strong></p>
<p class="STYLE7"><strong>时间</strong></p>
<p class="STYLE7"><strong>hmin</strong></p></td>
<td rowspan="4" align="center" width="72"><p class="STYLE7"><strong>油压</strong></p>
<p class="STYLE7"><strong>MPa</strong></p></td>
<td rowspan="4" align="center" width="72"><p class="STYLE7"><strong>套压</strong></p>
<p class="STYLE7"><strong>MPa</strong></p></td>
<td rowspan="4" align="center" width="72"><p class="STYLE7"><strong>回压</strong></p>
<p class="STYLE7"><strong>MPa</strong></p></td>
<td rowspan="4" align="center" width="72"><span class="STYLE7"><strong>生产情况</strong></span></td>
<td colspan="2" align="center" rowspan="2" width="144"><span class="STYLE7"><strong>求 产 起 始</strong></span></td>
<td colspan="2" align="center" rowspan="2" width="144"><span class="STYLE7"><strong>求 产 结 束</strong></span></td>
<td rowspan="4" align="center" width="72"><p class="STYLE7"><strong>时间</strong></p>
<p class="STYLE7"><strong>差值</strong></p>
<p class="STYLE7"><strong>hmin</strong></p></td>
<td rowspan="4" align="center" width="72"><p class="STYLE7"><strong>液 量</strong></p>
<p class="STYLE7"><strong><strong>差值</strong></strong></p>
<p class="STYLE7"><strong><strong><strong>m<sup>3</sup></strong></strong></strong></p></td>
</tr>
<tr height="20"> </tr>
<tr height="19">
<td rowspan="2" align="center" height="39" width="72"><span class="STYLE7"><strong>时间</strong></span></td>
<td rowspan="2" align="center" width="72"><p class="STYLE7"><strong>液量</strong></p>
<p class="STYLE7"><strong>读数</strong></p></td>
<td rowspan="2" align="center" width="72"><span class="STYLE7"><strong>时 间</strong></span></td>
<td rowspan="2" align="center" width="72"><p class="STYLE7"><strong>液量</strong></p>
<p class="STYLE7"><strong><strong>读数</strong></strong></p></td>
</tr>
<tr height="20"> </tr>
<%
dim WS_Officebjbs,WS_Officecccc,WS_Officescsj,m,n
Set rsi = Server.CreateObject("ADODB.Recordset")
sql1="SELECT DISTINCT jh FROM cyrbb where WS_Officesj='"&ssjj&"'"
rsi.open sql1,Conn,3,3
'response.Write(rsi.recordcount)
'response.Write(rsi("jh"))&"\\\\\"
rsi.pagesize=6 '定义一页显示的记录数目
tatalrecord=rsi.recordcount '获取记录总数目
tatalpages=rsi.pagecount '获取分页的数目
rsi.movefirst
nowpage=request("page") '用request获取当前页数,注意page是自己定义的变量并非函数
if nowpage&"x"="x" then '处理页码为空时的情况??怎么没事。我传给你吧我没asp
nowpage=1
else
nowpage=cint(nowpage) '将页码转换成数字型
end if
rsi.absolutepage=nowpage '将指针移动到当前显示页的第一条记录
n=1
for i= 1 to rsi.pagesize
if i<rsi.recordcount then