L
lxzmm_zy
Unregistered / Unconfirmed
GUEST, unregistred user!
我的ASP 中在Session_OnEnd中有如下代码,但执行后前面数据库的操作未有执行,但后面在线人数减一却被执行,请问高手是为啥?
'数据库操作
Set Conn=Server.CreateObject("ADODB.connection")
'Response.Write "driver={Microsoft Access Driver (*.mdb)};dbq= " &
Server.MapPath("../test/loginwebdate/loginrecord.asp")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq= " &
Server.MapPath("../test/loginwebdate/loginrecord.mdb")
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "loginrecord",conn,3,3
rs.addnew
rs("name")=cstr(Session.SessionID )&"退出"
rs("logindate")=now
rs.update
conn.close
'在线人数减一
if session("name")<>"" then
old_str=application("on_use")
find_str="$"&ssession("name")&"$"
application("on_use")=replace(old_str,find_str,"$" )
application("onend")="Session_OnEnd Event Run Secsessful !"
end if
Application.Lock
Application("online")=Application("online")-1
Application.unlock
'数据库操作
Set Conn=Server.CreateObject("ADODB.connection")
'Response.Write "driver={Microsoft Access Driver (*.mdb)};dbq= " &
Server.MapPath("../test/loginwebdate/loginrecord.asp")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq= " &
Server.MapPath("../test/loginwebdate/loginrecord.mdb")
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "loginrecord",conn,3,3
rs.addnew
rs("name")=cstr(Session.SessionID )&"退出"
rs("logindate")=now
rs.update
conn.close
'在线人数减一
if session("name")<>"" then
old_str=application("on_use")
find_str="$"&ssession("name")&"$"
application("on_use")=replace(old_str,find_str,"$" )
application("onend")="Session_OnEnd Event Run Secsessful !"
end if
Application.Lock
Application("online")=Application("online")-1
Application.unlock