This topic is locked
[SOLVED]

 Tracking when User has las logged in

3/13/2005 7:56:18 AM
ASPRunnerPro General questions
M
mskichu author

hello
I am looking for keeping tract of user last logged in
I am sure I can use Session("userid") for this but
I want to explain what Iam trying to do
I basically want to record when user has last logged.
In the user table
i have got a field called "userlastloggedin" how I can update this field
whenever user logs in then I want to update this field with "Now()" am I right ?
please do advice me
thanks in Advance
I luv ASPRunner

T
tsschicago 3/14/2005

This was given to me by the Administrator so im just passing it on to you I hope this work for you

----------------------------------------------------------------

You need to open the login.asp in Editor and find the following record

Response.Redirect Replace("menu.asp", "%20", " ")

else

rs.MoveNext

end if


or the following one

Response.Redirect Replace("..._list.asp", "%20", " ")

else

rs.MoveNext

end if


and put this code before it. The code can look like the following:

dbConnection.Execute "insert into logins (usr, tme) values ( '" &  Session("UserID") & "', #"& now() &"#)"


now you have to create a Table named "logins" with the field names "usr" and "tme" you cannot use field names such as "user" or "time" I found those to be conflicting with the reserved names for the DB. I hope this was helpfull...