分页查询出现错误
查询结果显示成功,但是点下一页、上一页时,出现错误。请大家帮忙看看。另错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>审批方案统计与查询</title>
<link rel=stylesheet type=text/css href=link.css></head>
<!-- #include file="topmain.asp" -->
<p> </p>
<body topmargin="50">
<div align="center">
<br />
<%
Dim conn
Dim rs
Dim db
Dim strsql
Dim pageSize
Dim page
Dim count
db= "data\baosong.mdb"
count=0
pageSize=1000
if request("txtshijian")<>"" then
strsql="select * from file where shenpistatus=1 AND shijian like'%" & request("txtshijian") & "%'"
end if
set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(db)
conn.Open()
rs.ActiveConnection=conn
rs.CursorType=3
rs.LockType=3
rs.Open strsql
IF rs.EOF Then
Response.Write("暂时没有任何记录!")
Response.End
End If
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
%>
<table border="1"width="85%"id="table1"height="292">
<tr>
<td height="43">
<p align="center">
<font size="4"color="#FF0000">
<%Response.Write(request("txtshijian"))%>
年审批合格的方案</font> </td>
</tr><label></label>
<tr>
<td><label>
<div align="center">
<table border="0" width="730"id=table2>
<tr>
<td width="85" height="20" align="center"><strong><font color="#000000" size="3" face="华文楷体">提交用户</font></strong></td>
<td width="327" align="center"><strong><font size="3" face="华文楷体"
color="#000000">方案名称</font></strong></td>
<td width="99" align="center"><strong><font size="3" face="华文楷体"
color="#000000">车务段</font></strong></td>
<td width="152" align="center"><strong><font size="3" face="华文楷体"
color="#000000">方案提交时间</font></strong></td>
<td width="45" align="center"><strong><font size="3" face="华文楷体"
color="#000000">查看</font></strong></td>
</tr>
<%
Do While Not rs.EOF AND count<>pageSize
%>
<tr>
<td align="center"><font size="2"><%=rs("uid").value%></font></td>
<td align="center"><font size="2"><%=rs("title").value%></font></td>
<td align="center"><font size="2"><%=rs("from").value%></font></td>
<td align="center"><font size="2"><%=rs("shijian").value%></font></td>
<td align="center"><a href="shenpi_view.asp?id=<%= rs("id").value %>"fanganmodify.asp?id=<%= rs("id").value %>">查看</a></td>
</tr>
<%
rs.MoveNext()
count=count+1
LOOP
%>
</table>
</label>
</div></td>
</tr>
<tr>
<td>
<p align="center"><font size="2">共有记录<%=rs.RecordCount%>
条,共有<%=rs.PageCount%>页
<a href=tongjichaxunjieguo.asp?page=1>第一页</a>,
<a href=tongjichaxunjieguo.asp?page=<%=(page-1)%>>上一页</a>,
<a href=tongjichaxunjieguo.asp?page=<%=(page+1)%>>下一页</a>,
<a href=tongjichaxunjieguo.asp?page=<%=rs.PageCount%>>最后一页</a>
</font> </tr>
</table>
<div>
<%
rs.Close()
Set rs=Nothing
conn.Close()
Set conn=Nothing
%>
</body>
</html>