知识库 电脑网络 商业经济 健康医疗 节能信息网 知识库全站文章索引
推荐: 使你上网远离木马程序、偷号软件
现在的位置: 首页 >> 电脑网络 >> 软件 >> 文章正文
求助 错误类型:ADODB.Recordset (0x800A0E79)对象打开时,不允许操作。
【字体: 
求助 错误类型:ADODB.Recordset (0x800A0E79)对象打开时,不允许操作。
对应代码: <% sub shoucang() if request.cookies(bookshop)(username)= then response.Redirect myuser.asp?action=login response.End end if set rs=server.CreateObject(adodb.recordset) dim rs2 set rs2=server.CreateObject(adodb.recordset) rs2.Open select actionid,bookid from shop_action where username=&request.cookies(bookshop)(username)& and zhuangtai=6,conn,1,1 rs.open select bookname,shichangjia,huiyuanjia,dazhe from shop_books where bookid in(&rs2(bookid)&),conn,1,1 rs.open select shop_action.actionid,shop_action.bookid,shop_books.bookname,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.dazhe from shop_books inner join shop_action on shop_books.bookid=shop_action.bookid where shop_action.username=&request.cookies(bookshop)(username)& and shop_action.zhuangtai=6,conn,1,1 response.write <table width=96% border=0 align=center cellpadding=1 cellspacing=1 bgcolor=#FFFFFF> if action=shoucang then response.write <form action=shopping.asp target=ckxp onsubmit=javascript:window.open(,ckxp,width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes);> else response.write <form name=form1 method=post action=shopping.asp> end if response.write <tr><td width=7% bgcolor=#5F95D3><div align=center><font color=#FFFFFF>选 择</font></div></td> response.Write <td width=45% bgcolor=#5F95D3><div align=center><font color=#FFFFFF>商品名称</font></div></td> response.Write <td width=14% bgcolor=#5F95D3><div align=center><font color=#FFFFFF>市场价</font></div></td> response.Write <td width=13% bgcolor=#5F95D3><div align=center><font color=#FFFFFF>会员价</font></div></td> response.Write <td width=12% bgcolor=#5F95D3><div align=center><font color=#FFFFFF>折 扣</font></div></td> response.Write <td width=9% bgcolor=#5F95D3><div align=center><font color=#FFFFFF>删 除</font></div></td></tr> do while not rs.eof response.write <tr><td bgcolor=#EFF5FE><div align=center><input name=bookid type=checkbox checked value=&rs(bookid)& ></div></td> response.write <td bgcolor=#EFF5FE STYLE=PADDING-LEFT: 5px><div align=left><a href=book.asp?id=&rs(bookid)& target=_blank>&rs(bookname)&</a></div></td> response.write <td bgcolor=#EFF5FE><div align=center>&formatnumber(rs(shichangjia),2)&元</div></td> response.write <td bgcolor=#EFF5FE><div align=center><font color=#FF6600>&formatnumber(rs(huiyuanjia),2)&元</font></div></td> response.write <td bgcolor=#EFF5FE><div align=center>&formatnumber(rs(dazhe)*100,2)&%</div></td> response.write <td bgcolor=#EFF5FE><div align=center> if action<>shoucang then response.Write <a href=shoucang.asp?action=del&actionid=&rs(actionid)&> else response.Write <a href=shoucang.asp?action=del&actionid=&rs(actionid)&&ll=22> end if response.Write <img src=images/trash.gif width=15 height=17 border=0></a></div></td></tr> rs.movenext loop rs.close end sub%>

问题出在第11,12行
rs.open "select bookname,shichangjia,huiyuanjia,dazhe from shop_books where bookid in('"&rs2("bookid")&"')",conn,1,1
rs.open "select shop_action.actionid,shop_action.bookid,shop_books.bookname,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.dazhe from shop_books inner join shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&request.cookies("bookshop")("username")&"' and shop_action.zhuangtai=6",conn,1,1

rs open了一次,没有关闭就继续open,肯定错误了

还有第10行
rs2.Open "select actionid,bookid from shop_action where username='"&request.cookies("bookshop")("username")&"' and zhuangtai=6",conn,1,1
下面没有判断数据是否存在,就继续执行,可能会发生不可预料的结果
用if rs2.eof then response.end 来判断

软件相关文章推荐
软件重要提示
软件特别推荐
软件论坛新帖
电脑网络 硬件 软件 互联网 操作系统 电脑常识 多媒体 反病毒 编程 手机 共享资源 
1、本文仅代表作者个人观点,与本网站无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作出任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2、本文来源于网络,所有权归原所有者所有,本站为非赢利网站,发布本文之目的在于传播更多信息,并不意味着本网站赞同或者否定本文部分以及全部观点或内容。如对本文内容有疑义、有任何问题,请及时与我们联系。email: ycsos.cn%gmail.com(%改为@)
友情链接:百度 GOOGLE 知识 节能信息网 设为首页 加入收藏 Copyright© 2005-2006 Ycsos.Cn Inc. 备案审批中…