Jag håller på med ett utloggnigsgrejs som inblandar global.asa. jag har gjort en funktion i global.asa som innehåller en databaskoppling samt ändrar online till offline. funktionen anropas från Sub Session_OnEnd. men det fungerar inte. inget händer. så jag undrar om nån kan hjälpa mig
koden från global.asa:
Sub offlogger
state=Session("UserId")
Set rs=Server.CreateObject("ADODB.Recordset")
Conn.Open "driver={MicroSoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/c3/db/usr_cltv.mdb") & " ;PWD=kroko"
logg = "UPDATE usr_tbl Set online=FALSE WHERE nick= '"&TRIM(state)&"' "
Conn.Execute(logg)
Conn.Close
Set Conn=nothing
rs.Close
Set rs=nothing
End Sub
Sub Application_OnStart
Application.Lock
Application("online") = 0
Application.Unlock
End Sub
Sub Application_OnEnd
End Sub
Sub Session_OnStart
Session.TimeOut = 10
Application.Lock
Application("online") = Application("online") + 1
Application.Unlock
End Sub
Sub Session_OnEnd
Application.Lock
Application("online") = Application("online") - 1
Application.Unlock
offlogger
End Sub
------------------
//McMiller
"Jag har tiden på min sida när jag gör diamanter av guld..."