日期:2014-05-17  浏览次数:20815 次

asp中查询记录分页的问题
在显示所有记录分页时"上一页",下一页都很正常,但是查询后的记录分页只显示第一页的记录,我知道好像要带参数,可我不道怎么加
代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<head>
</head>
<body>
<form method="post" action="index.asp" name="form1">
<center><input type="text" name="text1" size="20"></center>
<br><br>
<center><input type="text" name="text2" size="20"></center>
<br>
<center><input type="submit" name="button1" value="查"></center>
<center><input type="submit" name="button2" value="添加"></center>
<br>
</form>
<br>
<%
if request("button1")="查" then
if request.form("text1")<>"" then
cond="编号 like '%" & trim(request.form("text1")) & "%'"
end if
if request.form("text2")<>""then
cond="材料名称 like '%" & trim(request.form("text2")) & "%'"
end if
if request.form("text2")<>"" and request.form("text1")<>"" then
cond="编号 like '%" & trim(request.form("text1")) & "%'and 材料名称 like '%" & trim(request.form("text2")) & "%'"
end if
if cond<>""then
sql="select * from 入库表 where " & cond
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
count=0
pagesize=2
rs.pagesize=pagesize
page=request("page")
if isempty(page) or cint(page)<1 or cint(page)>rs.pagecount then
page=1
end if
rs.absolutepage=page
do while not rs.eof and count<>pagesize
%>
<form method=post action=index1.asp?id=<%=rs("id")%>>
<tr>
<table border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td height="22" width="100" align="center" bgcolor="#609B95"><font size="2"><%=rs("编号")%></font></td>
<td height="22" width="120" align="center" bgcolor="#609B95"><input type="text" name="text1" value="<%=rs("入库编号")%>"></td>
<td height="22" width="100" align="center" bgcolor="#609B95"><%=rs("日期")%></td>
<td height="22" width="120" align="center" bgcolor="#609B95"><%=rs("材料名称")%></td>
<td height="22" width="150" align="center" bgcolor="#609B95"><%=rs("型号规格")%></td>
<td height="22" width="80" align="center" bgcolor="#609B95"><%=rs("入库数量")%></td>
<td height="22" width="50" align="center" bgcolor="#609B95"><%=rs("计量单位")%></td>
<td height="22" width="80" align="center" bgcolor="#609B95"><%=rs("调入单位")%></td>
<td height="22" width="200" align="center" bgcolor="#609B95"><%=rs("备注")%></td>
<td align="center"><input type=submit name="