kick out users after a certain time of idle (1 Viewer)

alhabkk

Registered User.
Local time
Tomorrow, 01:38
Joined
Sep 9, 2013
Messages
49
Hi all,

Is there any option to kick out users after a certain time of idle.

Say, a user login my ms access and don't logout from database and he don't do anything in ms access. I want automatically logout from ms access after a certain time he is idle.

For your information i'm using ms access 2007.

Thanks in advance.
 

MLUCKHAM

Registered User.
Local time
Today, 22:38
Joined
Jul 23, 2013
Messages
89
I implemented this, but to do it I put code to log out on the timerInterval of the main form of the database. This timerInterval was enabled on the form load and the timerInterval set to 10 second. Every 10 seconds the form would increment a counter which was declared as a global at the top of the form. In the timerInterval I tested the counter and if it was greater than 30 then the user was logged out (5 minutes)

I then put some code on the mouseMove event on the detail section on the form which reset the counter to 0 everytime the mouse moved. Also added a function that reset the counter if the form loaded another form etc.

It works, but takes a little bit of time to set it up.
 

alhabkk

Registered User.
Local time
Tomorrow, 01:38
Joined
Sep 9, 2013
Messages
49
Could sombody explaine it to me step by step. im struggling!
 

RuralGuy

AWF VIP
Local time
Today, 15:38
Joined
Jul 2, 2005
Messages
13,826
Did you select one from the link I gave you? If so, which one?
 

alhabkk

Registered User.
Local time
Tomorrow, 01:38
Joined
Sep 9, 2013
Messages
49
its give popup message only, i need to kick users out of db
 

RuralGuy

AWF VIP
Local time
Today, 15:38
Joined
Jul 2, 2005
Messages
13,826
Have you created the form as the link suggests? Do you open it hidden with the AutoExec macro as suggested?
 

RuralGuy

AWF VIP
Local time
Today, 15:38
Joined
Jul 2, 2005
Messages
13,826
You need to add this line:
Application.Quit acSaveYes

...like this:
Code:
If ExpiredMinutes >= IDLEMINUTES Then
   ' ...if so, then reset the expired time to zero...
   ExpiredTime = 0
   ' ...and call the IdleTimeDetected subroutine.
   IdleTimeDetected ExpiredMinutes
   [COLOR="Red"][B]Application.Quit acSaveYes[/B][/COLOR]
End If
 

alhabkk

Registered User.
Local time
Tomorrow, 01:38
Joined
Sep 9, 2013
Messages
49
You need to add this line:
Application.Quit acSaveYes

...like this:
Code:
If ExpiredMinutes >= IDLEMINUTES Then
   ' ...if so, then reset the expired time to zero...
   ExpiredTime = 0
   ' ...and call the IdleTimeDetected subroutine.
   IdleTimeDetected ExpiredMinutes
   [COLOR=red][B]Application.Quit acSaveYes[/B][/COLOR]
End If

wow u made my work a piece of cake
now its work greate but I would like to kick users automatically ( without shoing pop-up message)? and in case i want auto Logout Users from DB for maintenance?

Thanks alot RuralGuy
 

RuralGuy

AWF VIP
Local time
Today, 15:38
Joined
Jul 2, 2005
Messages
13,826
If you want to kick off the user without showing the MsgBox then don't call the IdleTimeDetected procedure.
 

alhabkk

Registered User.
Local time
Tomorrow, 01:38
Joined
Sep 9, 2013
Messages
49
If you want to kick off the user without showing the MsgBox then don't call the IdleTimeDetected procedure.

Its work....:D
Thanks alot
there is away to force users to kick them in case of maintenance :rolleyes:?
 
Last edited:

Users who are viewing this thread

Top Bottom