Help me to see where the following code is wrong:
The main purpose of this program is to make online number statistics, and update the online situation of users in the user table when the user is offline (user table: user, field online, if online = 1, indicating that the user is online, if online = 0 means the user offline)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
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 'When opening a website, the number of online people plus 1
Application.unlock
End Sub
SUB session_onend
Application.lock
Application ("Online") = Application ("Online") - 1 'Release Session, the number of online people is 1
Application.unlock
IF session.contents ("pass") THEN
Application ("conn"). Open "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & applibility ("db")
Application.lock
Application ("conn"). EXECUTE ("Update [user] set online = 0 where userid = '" & session.contents ("userid") & "'") 'Change the session (userid) this user on the table 0
Application.unlock
Application ("conn"). Close
END IF
End Sub
script>