求助'对象打开时,不允许操作'
ADODB.Recordset 错误 '800a0e79' 对象打开时,不允许操作。
/yslogin.asp,行 34
付代码:
<!-- #include file="include/conn.asp" -->
<!-- #include file="include/function.asp" -->
<%
'进行安全性监测,看数据来源是否是本服务器页面
if not instr(1,Request.ServerVariables("http_Referer"),Request.ServerVariables ("SERVER_NAME"),1)=8 then
response.redirect "index.asp"
end if
%>
<%
dim Rs,SqlStr
dim UserName,UserPass
username=SafeRequest(Request.Form("username"),0)
password=SafeRequest(Request.Form("password"),0)
'登陆成功
sub loginok()
Session.Timeout=60
session("username")=rs("username")
conn.execute("update usermsg set islogin=1,logintime='"&now()&"' where username='"&username&"'")
str="<script language=javascript>alert('您已成功登陆!\n\n您还剩下"&rs("validdate")-date()&"天的访问期限!\n\n请安全退出!');"
If rs("memo")=1 then
str=str&"window.location='member_1.asp';"
Elseif rs("memo")=2 then
str=str&"window.location='member_2.asp';"
Elseif rs("memo")=3 then
str=str&"window.location='member_3.asp';"
End if
str=str&"</script>"
response.Write(str)
end sub
SqlStr="select memo,username,password,validdate,islogin,isshenhe,default,logintime from usermsg where username='"&username&"' and password='"&password&"'"
set Rs=conn.execute(SqlStr)
RS.LockType=3
if Rs.BOF and Rs.EOF then
Response.Write("<script language=javascript>history.go(-1);</script>")
else
'if rs("default") then
'Session.Timeout=60
'session("username")=rs("username")
'response.Redirect("hidden_member.asp")
'end if
if cint(rs("islogin"))=1 then
'检查会员登陆是否超过三分钟
t1day=day(rs("logintime"))
t1hour=hour(rs("logintime"))
t1minute=minute(rs("logintime"))
t1date=(t1day*24*60)+(t1hour*60)+t1minute
t2day=day(now)
t2hour=hour(now)
t2minute=minute(now)
t2date=(t2day*24*60)+(t2hour*60)+t2minute
if (t2date-t1date)>3 then
call loginok()
else
Response.Write("<script language=javascript>alert('帐号重复登陆,已锁定!请联系管理员');history.go(-1);</script>")
rs("isshenhe")="0"
response.end
end if
elseif rs("validdate")-date()<0 then
Response.Write("<script language=javascript>alert('您的帐号已过期"&date()-rs("validdate")&"天!\n\n请联系站长续期!');history.go(-1);</script>")
response.end
elseif cint(rs("isshenhe"))=0 then
Response.Write("<script language=javascript>alert('你的权限尚未开通!');history.go(-1);</script>")
response.end
else
call loginok()
end if
end if
call close_rs()
call close_conn()
%>
本来是想通过两用户同时登陆同一帐号时,修改isshenhe的值为0,达到锁定帐户的功能.