标题:[求助]有问题请教大家帮忙
只看楼主
剑奴客
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-1-1
 问题点数:0 回复次数:2 
[求助]有问题请教大家帮忙

这个搜索功能的实现里面总是出现对象关闭不能操作或对象打开时不能操作,我应该怎么解决
大家多多帮忙呀



<!--#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>

搜索更多相关主题的帖子: next include border center 
2007-01-06 15:00
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
得分:0 
rs.open sql,conn,3
rs.close
conn.close
你自己给关闭了
2007-01-06 15:34
雨蒙珍珍
Rank: 1
等 级:新手上路
威 望:1
帖 子:169
专家分:0
注 册:2006-4-10
得分:0 
自己要有调试程序的能力。还有就是斑竹给你说了错误,应该说谢谢。不然就没有人帮你了!
2007-01-07 11:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-114594-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.458561 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved