<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_onStart
dim conn
dim connstr
on error resume next
DB="../DataBase/Data/Class.mdb"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(DB)
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
sql="select CountTotal from [Counter]"
set rs=Conn.execute(sql)
Application("OnLine") = 0
Application("Total") = rs("CountTotal")
rs.close
Set rs=nothing
Conn.Close
Set Conn=Nothing
End Sub
Sub Session_onStart
Session.TimeOut=30
Application.Lock
Application("Total")=Application("Total")+1
Application("OnLine") = Application("OnLine") + 1
Application.Unlock
End Sub
Sub Session_OnEnd
Application.Lock
Application("OnLine") = Application("OnLine") - 1
Application.Unlock
End Sub
Sub Application_onEnd
dim conn
dim connstr
on error resume next
DB="../DataBase/Data/Class.mdb"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(DB)
Sql="update [Counter] set CountTotal="+Application("Total")+""
Conn.Execute(Sql)
Conn.Close
Set Conn=Nothing
End Sub
</SCRIPT>
WWW启动可以正确的从数据库中读出来,
但是当停止时,不能正确的读入数据库。
大家帮忙看一下!!
THANKS!!
[此贴子已经被作者于2006-1-27 0:41:38编辑过]