Hi
I have code in my login.asp which sets the online field in user database to
true or 1. I am trying to use the same code in global.asa to change back the
online field to 0 but it doesn't work. The code is very simple and it should
work, any idea why it doesn't?
Sub Session_OnEnd
If Session("User_I D")<>" " Then ' check if user has logged in
before.
ConnectionStrin g = "Driver={SQ L
Server};UID=eme nworldcom2;Pass word=BBBBBB;DAT ABASE=Mydatabas e;SERVER=111.11 1
..111.11\i1"
Set Conn2Gallery = Server.CreateOb ject("ADODB.Con nection")
Set CmdTrackUser = Server.CreateOb ject("ADODB.Rec ordset")
Conn2Gallery.Op en ConnectionStrin g
SQL.CommandText = "SELECT Users.* FROM Users WHERE (User_ID = " &
Session("User_I D") & ")"
SQL.CommandType = 1
Set SQL.ActiveConne ction = Conn2Gallery
CmdTrackUser.Op en SQL, , 1, 3
CmdTrackUser.Fi elds("Online") = 0
CmdTrackUser.Up date
CmdTrackUser.Cl ose
Set CmdTrackUser = Nothing
Conn2Gallery.Cl ose
Set Conn2Gallery = Nothing
END IF