各位高手帮我看看以下代码哪里出错:
本程序主要目的是作在线人数统计,及在用户离线时更新用户表中用户的在线情况(用户表:user,字段online,若online=1,表示用户在线,若 online=0则表示用户离线)
--------------global.asa-------------------------------
<script LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
application("online")=0
set application("conn")=Server.CreateObject("ADODB.Connection")
application("db")=Server.MapPath("/autohz2003.mdb")
End Sub
sub Application_OnEnd
set application("conn")=nothing
End Sub
Sub Session_OnStart
application.lock
application("online")=application("online")+1'打开网站时,在线人数加1
application.unlock
End Sub
Sub Session_OnEnd
application.lock
application("online")=application("online")-1'释放session时,在线人数减1
application.unlock
if session.contents("pass") then
application("conn").open "DRIVER={Microsoft Access Driver (*.mdb)}; dbq="&application("db")
application.lock
application("conn").Execute("update [user] set online = 0 where userid='"&session.contents("userid")&"'")'将session(userid)这个用户在表中的online改为0
application.unlock
application("conn").close
end if
End Sub
</script>