INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Tracking login, logout activity ms access

Tracking login, logout activity ms access

(OP)
Hello everyone,

Here i got my work to create a program that has login and logout system. (and also another feature)
I want to do tracking to login and logout system.

So,
If user1 do login, then the system puts the user1 id number and name and create new record. (I used append query)
if user1 do logout, then the system update the record to the user1 record. (I used update query)
then if user2 do login, then the system do the same as the other login.
if user2 logout then same

but, if in another time, user1 do login again, then the system puts the user1 id number and name into new record. (not the same record as before)
and when user1 do logout, the system update its record

How does it work?
i've been googling for my probs, but i got nothing

could someone help me? bugeyed
Thanks thanks


The table that hold the user log contains :
1. No (as primary key and set to autonumber) -> i think to specify the append and update query
2. ID (the user id number)
3. Account (the user name)
4. Login date (i append this to date())
5. Login time (append as time())
6. Logout date (same as above)
7. Logout time (same as above)

The table could be like this :
No ID Login Date Login Time Logout Date Logout Time
1 user1 23/02/2016 01.00 23/02/2016 02.00
2 user2 24/02/2016 10.00 24/02/2016 12.00
3 user1 24/02/2016 02.00 24/02/2016 05.00
4 user2 25/02/2016 01.00 25/02/2016 02.00
5 user3 25/02/2016 05.00 25/02/2016 05.30

RE: Tracking login, logout activity ms access

Make fields 4 and 5 as one field - DateTime (Login, default value: Now()), make fields 6 and 7 as one field DateTime (Logout).

LogTable:

No ID       Login            Logout 
 1 user1    23/02/2016 01.00 23/02/2016 02.00
 2 user2    24/02/2016 10.00 24/02/2016 12.00
 3 user1    24/02/2016 02.00 24/02/2016 05.00
 4 user2    25/02/2016 01.00 25/02/2016 02.00
 5 user3    25/02/2016 05.00 25/02/2016 05.30 
 

On Login:
'In case User1 crashed last time and never logged out (optional):
UPDATE LogTable
Set Logout = #1/1/2000#
Where ID = 'User1'
And Logout IS NULL

INSERT INTO LogTable (ID, Login)
VALUES ('User1', Now())


On Logout:
UPDATE LogTable
Set Logout = Now()
Where ID = 'User1'
And Logout IS NULL



Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

RE: Tracking login, logout activity ms access

(OP)
Thanks, Andy!

That's work

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close