ADODB.Recordset 错误 '800a0e79'对象打开时,不允许操作。/投票系统/toupiao.asp,行 18
<!--#include file="conn.asp"-->
<%
if request.Cookies("thekeyr")="" then
response.Write("<script language='javascript'>alert('你还没有登陆,请先登陆!');history.back();</script>")
response.End()
end if
%>
<%
if trim(request.form(("code1")))<>session("code") then
response.Write("<script language='javascript'>alert('你没有输入验证码或者验证码错误!');history.back();</script>")
response.End()
end if
set rs=server.createobject("adodb.recordset")
sqll="select * from [pin] where pname='"&request.Cookies("thekeyr")&"'"
rs.open sqll,conn,1,3
if rs.eof then
sql="select * from [article] where ID="&request.form("id")&""
rs.open sql,conn,1,3
rs("c")=rsl("c")+1
rs.update
rs.addnew
rs("pname")=request.Cookies("thekeyr")
rs("id")=request.Form("id")
rs.update
response.write("<script language='javascript'>alert('投票成功!');</script>")
response.Redirect("http://www.shidajiajiao.com/投票系统")
response.End()
else
response.Write("<script language='javascript'>alert('你已经投过票了!');history.back();</script>")
end if
%>
请各位高手帮我看看这段代码为何会出现题目中的错误呢??
------解决方案--------------------
set rs=server.createobject("adodb.recordset")
sqll="select * from [pin] where pname='"&request.Cookies("thekeyr")&"'"
rs.open sqll,conn,1,3
if rs.eof then
sql="select * from [article] where ID="&request.form("id")&""
rs.open sql,conn,1,3
红色部分,第一次打开没关闭,又打开一次,当然出错,打开一次用完了请关闭