ASP报错 ADODB.Recordset '800a0e78' 对象关闭时,不允许操作。
答案:2 悬赏:50 手机版
解决时间 2021-03-19 01:40
- 提问者网友:愿为果
- 2021-03-18 20:29
带#号的那行出错<br><%if session("admin")="" then<br><br>response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"<br>response.End<br>else<br>if session("flag")>2 then<br>response.Write "<p align=center><font color=red>您没有此项目管理权限!</font></p>"<br>response.End<br>end if<br>end if<br>selectbookid=trim(request("selectdel"))<br>set u=conn.execute("select * from admin_user where admin ='"&session("admin")&"'")<br>if selectbookid<>"" then<br>conn.execute "delete from money_list where id in ("&selectbookid&")"<br>response.Redirect("get_money.asp")<br>response.End<br>end if<br>action=trim(request("site"))<br>if action = "未处理" then<br>conn.execute("update money_list set site = '未处理' where id="&trim(request("id")))<br>elseif action = "已经处理" then<br>set rs1=conn.execute("select * from money_list where id ="&trim(request("id")))<br>if rs1("site") <> "已经处理" then<br>conn.execute("update money_list set site = '已经处理' where id="&trim(request("id")))<br>conn.execute("update money_list set set_time = now() where id="&trim(request("id")))<br>set rs=server.CreateObject("adodb.recordset")<br>sql="select * from money_list where id ="&trim(request("id"))<br>rs.open sql,conn,2,3<br>rs("chuliren")=u("admin")<br>rs.update<br>end if<br>end if<br>%><br><html><br><head><br><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><br><link rel="stylesheet" href="manage.css" type="text/css"><br><script type="text/JavaScript"><br><!--<br>function MM_jumpMenu(targ,selObj,restore){ //v3.0<br> eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");<br> if (restore) selObj.selectedIndex=0;<br>}<br>//--><br></script><br></head><br><BODY background="../images/admin/back.gif"><br><%<br> dim namekey,checkbox,action,money_id,user_name,add_time1,add_time2,site<br> action=request.QueryString("action")<br> checkbox=request("checkbox")<br> namekey=request("namekey")<br> money_id=request("money_id")<br> user_name=request("user_name")<br> add_time1=request("add_time1")<br> add_time2=request("add_time2")<br> site=request("site")<br> if InStr(namekey,"'")>0 then<br>response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"<br>response.end<br>end if<br> if namekey="" then namekey=request("namekey")<br> if checkbox="" then checkbox=request("checkbox")<br> id =trim(request("id"))<br> if id ="" then<br> id=0<br> end if<br> set rs=server.CreateObject("adodb.recordset")<br> if money_id = "" and user_name = "" and add_time1 = "" and add_time2 = "" and site = "" then<br> rs.open "select * from money_list where money_type = 2",conn,3,1<br> end if<br> if rs.eof And rs.bof then ####################<br> Response.Write "<br><br><br><br><br><br><br><br><br><br><br><br><p align='center' class='contents'> "&namekey&" 无此信息,请点击<a href='get_money.asp'>返回</a>重新搜索!</p><br><br><br><br><br><br><br><br><br><br><br><br>"<br>end if<br>%><br>问题如果解决了,还可追加
最佳答案
- 五星知识达人网友:旧脸谱
- 2021-03-18 21:18
if money_id = "" and user_name = "" and add_time1 = "" and add_time2 = "" and site = "" then
rs.open "select * from money_list where money_type = 2",conn,3,1
end if
出错可能是没有满足条件吧 rs.open没有执行,当然就报错了
rs.open "select * from money_list where money_type = 2",conn,3,1
end if
出错可能是没有满足条件吧 rs.open没有执行,当然就报错了
全部回答
- 1楼网友:北城痞子
- 2021-03-18 21:23
你的错误是对象关闭后 不能接着执行 必须再.open()才能执行以后的操作。
看你的程序:
例如你的rsp.open()后,的确执行过一次rsp.close 但是你再执行下面的时候没有再打开rsp.open(),所以会报“对象关闭时,不允许操作”
不知道你明白没有?就是说执行完.open操作,要执行.close操作。执行完.close操作后,要及时再执行.open操作才能执行下面的操作。也不知道你听明白没!!!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯