求助:有一段删除代码,运行时提示“ADODB.Recordset: 对象关闭时,不允许操作。”
<%if session("aleave")="check" then
response.write"<script language=javascript>alert('对不起,你没有这个权限!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
action=request.QueryString("action")
referer = Request.ServerVariables("HTTP_REFERER")
if action="delarticle" then
If Request.Form("DelID")="" or isnull(Request.Form("DelID")) or isempty(Request.Form("DelID")) then
response.write "<font style='color:red;font-size:12px'>请选择要删除的信息</font>"
else
Num=request.form("DelID").count
for i=1 to Num
set rs = server.CreateObject ("Adodb.recordset")
rs.open "delete from news where id="&request.form("DelID")(i),conn,3,3
set rs = server.CreateObject ("Adodb.recordset")
rs.Open "select from shop_pinglun where id="&request.form("DelID")(i),conn,3,3
do while not rs.eof
rs.delete
rs.movenext
loop
next
rs.close
set rs=nothing
end if
response.redirect (referer)
else
set rs=server.createobject("adodb.recordset")
rs.open "delete from news where id="&request.querystring("id"),conn,3,3
set rs=server.createobject("adodb.recordset")
rs.Open "delete from shop_pinglun where id="&request.querystring("id"),conn,3,3
do while not rs.eof
rs.delete
rs.movenext
loop
rs.close
set rs=nothing
response.write "<script language='javascript'>" & chr(13)
response.write "alert('成功删除!');" & chr(13)
response.write "window.document.location.href='admin_info.asp';"&chr(13)
response.write "</script>" & chr(13)
response.end
end if
%>
这是整个页面的代码,在运行删除操作时,调试器提示“ADODB.Recordset: 对象关闭时,不允许操作。”位置在“set rs=nothing”
请各位高手给分析一下问题出在什么地方?
注:删除操作后,文章被删除了,但是会有错误提示。