Forums

ASP

This topic is locked

updating database from global.asa

Posted 12 Dec 2003 11:32:33
1
has voted
12 Dec 2003 11:32:33 Katherina Higgins posted:
I need to update a database table with the time the user logs out of my site/when their session ends.
I've been using a global.asa file with the following Session_OnEnd code, but it doesnt seem to be working for me........ can anybody help?

<script language=vbscript runat=server>
Sub Session_OnEnd
set conn = Server.CreateObject("ADODB.Connection"
conn.Open "DSN=....."

query = "UPDATE User_LogTime SET Logout_Time = "now()" WHERE SID="&Session.SessionID&"

conn.Execute(query)
conn.Close
set conn = Nothing
End Sub
</script>

Reply to this topic