分页显示问题,点下一页无效,给80分
wzbx 2004-06-21 09:35:15 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/wuliu.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="542" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="e1e1e1">
<tr>
<td width="476"><font color="#FF0000" size="2" face="宋体">[ 需求查询 ]
</font></td>
</tr>
<tr>
<td height="33" align="center" bgcolor="#FFFFFF"><form action="" method="post" name="form1">
<input name="searchkey" type="radio" value="1" checked>
<font size="2" face="宋体">执行</font> <input type="radio" name="searchkey" value="0">
<font size="2" face="宋体">终止 时间</font>:
<input name="keywords" type="text" id="keywords">
<input type="submit" name="Submit3" value="查询">
</form>
</td>
</tr>
</table>
<table width="540" height="37" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#E1E1E1" class="xuxian">
<tr>
<td width="86" height="27" align="center"><font size="2" face="宋体">流水号</font></td>
<td width="103" height="27" align="center"><font size="2" face="宋体">日期</font></td>
<td width="333" height="27" colspan="2" align="center"><font size="2" face="宋体">摘要</font></td>
</tr>
<%searchkey=request.Form("searchkey")
keywords=request.Form("keywords")
if searchkey<>"" then
if searchkey="1" then
set conn=server.CreateObject("ADODB.connection")
connstr = "dsn=zlmis;uid=cw;pwd=cwpass;"
conn.open connstr
sql="select F_JHNM,F_ZY from GYCGJH1 where F_DATE Like '"&keywords&"'+'%'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
pmcount=10
rcount=rs.recordcount
if pmcount="" or isempty(pmcount) or pmcount<1 then
pmcount=10
end if
rs.pagesize=pmcount
mpage=rs.pagecount
pageno=request("pageno")
if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
if rs.eof or rs.bof then
%>
<tr bgcolor="#FFFFFF">
<td height="16" colspan="4" align="center">还没有相关的资料!</td>
</tr>
<%else
rs.absolutepage=pageno
loopno=pmcount
%>
<%
do while not rs.eof and loopno>0
%>
<tr bgcolor="#FFFFFF">
<td width="97" height="22" align="center"> <%=rs("F_JHNM")%></td>
<td width="267" ><%=rs("F_ZY")%></td>
</tr>
<%
rs.movenext()
loopno=loopno-1
loop
%>
<tr>
<td height="29" colspan="4" align="center">
<%
if cint(pageno)<2 then
response.write " 首页 | 上一页"
else
response.write "<a href=jhxq.asp?pageno=1>首页</a> | "
response.write "<a href=jhxq.asp?pageno="&pageno-1&">上一页</a>"
end if
%>
|
<%
if cint(mpage-pageno)<1 then
response.write "下一页 | 尾页"
else
response.write "<a href=jhxq.asp?pageno="&pageno+1&">下一页</a> | "
response.write "<a href=jhxq.asp?pageno="&mpage&">尾页</a>"
end if
%>
| 共计<%=cstr(rcount)%>主题<%=cstr(pageno)&"/"&cstr(mpage)&"页"%></td>
</tr>
<%
rs.close
end if
end if
end if
%>