这个搜索功能的实现里面总是出现对象关闭不能操作或对象打开时不能操作,我应该怎么解决
大家多多帮忙呀
<!--#include file="conn.asp"-->
<!--#include file="showrs.asp"-->
<%
sub showpage(rs,page)
response.write"<center><table border=1>"
response.write"<tr bgcolor=#ddeeff>"
for i=0 to rs.fields.count-1
response.write"<td>"&rs.fields(i).name&"</td>"
next
response.write"</tr>"
rs.absolutepage=page
for i=1 to rs.pagesize
response.write"<tr>"
response.write"<td>"&rs.fields(0).value&"</td>"
for j=1 to rs.fields.count-1
response.write"<td>"&rs.fields(j).value&"</td>"
next
response.write"</tr>"
rs.movenext
if rs.eof then exit for
next
response.write"</table></center>"
end sub
set rs=server.createobject("adodb.recordset")
response.write"共找到<b>"
response.write rs.recordcount
response.write"</b>条"
response.write"<font color=red><i><b>"
select case request("seachkey")
case "busname"
response.write "车名"
case "csmc"
response.write "厂商"
end select
response.write"</b></i></font>包含"
response.write"<font color=red><i><b>"
response.write request("guanjianzi")
response.write"</b></i></font>"
response.write "的记录:<p>"
gjz=request("guanjianzi")
cpmc=request("busname")
if cpmc="车名" then
sql="select cpbh as '汽车编号',cpmc as '汽车名称',jg as'价格',kcl as '库存量',xsmc as '厂商名称' from cp where cpmc='"&gjz&"'"
else
sql="select cpbh as '汽车编号', cpmc as '汽车名称',jg as'价格',kcl as '库存量',xsmc as '厂商名称' from cp where xsmc='"&gjz&"'"
end if
rs.open sql,conn,3
rs.close
conn.close
%>
<html>
<body background="" bgcolor=green>
<%
rs.pagesize=10
page=cint(request("pagetext"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
showpage rs,page
%>
<div align=center><form action="sousuocl.asp" method="get">
<%
if page<>1 then
response.write("<a href=busxx.asp?pagetext=1 target=main>第一页</a>")
response.write("<a href=busxx.asp?pagetext="&(page-1)&" target=main>上一页</a>")
end if
if page<>rs.pagecount then
response.write("<a href=busxx.asp?pagetext="&(page+1)&" target=main>下一页</a>")
response.write("<a href=busxx.asp?pagetext="&rs.pagecount&" target=main>最后一页</a>")
end if
%>
<p>输入页号:<input type=text name="pagetext" size=3>
总页数:<font color="red"><%=page%>/<%=rs.pagecount%></font></p>
</form></div></body></html>