I do not track exit time myself, so you'll have to come up
with an SQL statement for that to happen. Someone else may
have be able to help you out with a script to edit the login
table when the variable is abandoned or they log off
Here is what I use:
'Part 1 validates that they are a member
strSQL1 = "SELECT * FROM Roster WHERE UserName = '" & _
strUserName & "' AND Password = '" & _
strPassword &"'"
'Part II checks to see if they have Admin Status
strSQL2 = "SELECT * FROM Roster WHERE UserName = '" & _
strUserName & "' AND AdminDuty = True"
'Part III SQL setup and execution
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open application ("Database1_ConnectionString")
'Part III logs their attempt into the database
strSQL3 = "INSERT INTO Usage (User, UsedTime) VALUES ('"&
strUserName &"', '"& AttemptTime &"')"
Set objRS1 = objConn.Execute (strSQL1)
Set objRS2 = objConn.Execute (strSQL2)
objConn.Execute (strSQL3)
'Part IV check to see of they are authorized, and set
session variables for authorization and name
If Not objRS1.EOF Then
Session("bolAuthenticated") = True
Session("strUserName") = strUserName
End If
'Part V check to see if they have admin status, and set
session variable for admin. Then redirect based on it
If Not objRS2.EOF then
Session("bolAdmin") = True
Response.Redirect "AdminPage.asp"
Else
Response.Redirect "ClientPage.asp"
End If
Tina wrote:
: Do you have an example?. Thanks
:
: "Mike Mueller" wrote:
:
::
::: Hi,
:::
::: Does anyone create a asp page to track users login
::: and logout time?. Thanks in advance
::
::
:: If you are using asp to validate the users, add another
:: sql statement to another table to write who logged in
:: and when You can also use a logout button to clear their
:: session variables, and use a sql statement to write the
:: log out info. However, this will not happen if they do
:: not logout.