,我的分页代码怎么没用啊,帮我看看啊
我分页size有用,但是点下一页就没用啊,我直接在地址加page参数也不跳啊,下面是代码,麻烦帮帮忙啊set rs1 = server.CreateObject("adodb.recordset")
if namechoice="" then
sql="select * from tblTurnDay_Detail where date0 between #"&starttime&"# and #"&endtime&"# order by date0 desc"
else
sql="select * from tblTurnDay_Detail where cardid='"&namechoice&"' and date0 >=#"&starttime&"# and date0<=#"&endtime&"# order by date0 desc"
end if
rs1.open sql ,conn1,3,3
%>
<table width="95%" style="border:1px solid black; text-align:center;">
<tr bgcolor="#CCFF99">
<td width="9%">日期</td>
<td width="8%">卡号</td>
<td width="11%">姓名</td>
<td width="12%">上班时间</td>
<td width="12%">下班时间</td>
<td width="14%" widht="auto">考勤状态</td>
<td width="34%" widht="auto">备注</td>
</tr>
<%dim page,maxpage ,icount,tmp,ipagesize
tmp=request.ServerVariables("query_string")
ipagesize=rs1.pagesize
rs1.pagesize=99
maxpage=rs1.pagecount
icount = rs1.recordcount
if page = "" then
page =1
else
page = cint(trim(request("page")))
end if
if page <1 then
page =1
end if
if page > maxpage then
page = maxpage
end if
if page = maxpage then
x = icount-(maxpage-1)*rs1.pagesize
else
x=rs1.pagesize
end if
if rs1.eof or rs1.bof then%>
<li>no data</li>
<%else
rs1.absolutepage = page
do until rs1.eof or x<0
%>
<tr bordercolor="#0033CC" bgcolor="#CCFFFF" class="123">
<td width="9%" class="123"><%=rs1("date0")%></td>
<td width="8%"><%=rs1("cardid")%></td>
<td width="11%">
<% set rs4 = server.CreateObject("adodb.recordset")
rs4.open "select * from tblemp where cardid='"&rs1("cardid")&"'",conn1,1,1
response.Write (rs4("EmpName"))
rs4.close
set rs4 = Nothing
%> </td>
<td width="12%"><%=rs1("in0")%></td>
<td width="12%"><%=rs1("out0")%></td>
<td width="14%">
<%
if trim(rs1("strdesc")) <>"" then
response.Write ("<font color=red>"&rs1("strdesc")&"</font>") %>
<%else
response.Write "正常"
end if
%>
</td>
<td width="11%"></td>
<%
x=x-1
rs1.movenext
loop
end if%>
</table>
<li style="text-align:center; width:95%; line-height:20px; margin-top:5px;padding-top:10px; font-size:14px; background:#CCFFFF;">
共<%=icount%>条记录 当前第<%=page%>/<%=maxpage%>页
<a href="inquiry.asp?<%=tmp%>&page=<%=1%>">首页</a>
<a href="inquiry.asp?<%=tmp%>&page=<%=page-1%>">上一页</a>
<a href="inquiry.asp?<%=tmp%>&page=<%=page+1%>">下一页</a>
<a href="inquiry.asp?<%=tmp%>&page=<%=maxpage%>">尾页</a>
转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs1.PageCount
if i = page then%>
<option value="inquiry.asp?<%=tmp%>&page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="inquiry.asp?<%=tmp%>&page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页
</li>
<%
rs1.close
set rs1 = nothing
%>