对象关闭时,不允许操作的问题--对查询结果分页错误
对查询结果分页,应该是rs.close的问题吧?我也不确定,点击下一页后就报错,大侠们帮我看看。
我的代码如下:
<%
set rs=server.createobject( "adodb.recordset ")
t1=trim(request( "t1 "))
R1=trim(request.form( "R1 "))
if request( "t1 ")= "无关键字 " or request( "t1 ")= " " then
rs.open "select * from baogao where # "& date()& "# > = date_begin and # "&date()& "# < date_end ",conn,1,1
elseif R1= "1 " then
rs.open "select * from baogao where # "& date()& "# > = date_begin and # "&date()& "# < date_end and bgid like '% "&t1& "% ' ",conn,1,1
.
.
.
end if
if rs.eof //此行为报错行 then response.Redirect "error.asp "
response.end
end if
%>
<%
filename= "chaxun_more.asp "
rs.pagesize=24
num=rs.recordcount
maxcount=cint(rs.pagecount)
page=request( "page ")
if page= " " or page <= 0 then page = 1
if cint(page) > cint(maxcount) then page=maxcount
rs.absolutepage=cint(page)
i=0
%>
<tr>
<tr>
<td height= "38 " valign= "middle " >
<table width= "413 ">
<tr>
<td width= "16 " height= "61 "> </td>
<td width= "385 ">
<%for i=1 to rs.pagesize%>
<div id= "fang "> </div>
<span style= "float:left; ">
<img src= "image/f_5.gif " width= "3 " height= "3 " align= "middle " >
<a href= "report1.asp?id= <%=rs( "id ")%> " targe