If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > PC based Database Applications > Brilliant Database > Closing database (Idle time)

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Jan 2012
Posts: 81
Closing database (Idle time)

Hey guys,

Is it possible to have the database automatically closed after a set period of idle time as in the user is not using the database?
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Sep 2011
Location: Australia
Posts: 218
Close database

I am working on similar idea but would like to log out user instead of closing database - unfortunately the menu item switch user is not exposed to scripts.Will try change user access action instead.
Intended procedure:
Create Global variable (math) called active.
Set this variable to zero when ever any record selected - every form will need a script, also add line to most other scripts to zero variable.
The idea is to maintain variable at zero while any database activity.
Next create 2 timers - one running at 1 minute and incrementing variable by 1+current value and the other running at 10 minutes, so if "active" has reached say 10 then do some action (close , change etc) else if less then 10 do nothing.
Have been in holding pattern waiting on V10 in case function "built in" but does not appear so.
Reply With Quote
  #3 (permalink)  
Registered User
Join Date: Jul 2012
Location: Ireland
Posts: 578
Set this variable to zero when ever any record selected
Very good idea.

Food for thought. It will obviously totally depend on the nature of your databases use, but for many I've written the end user would have a single record open for upwards of an hour and actually using it while doing other things.

That considered, you might also consider also adding that function to “On Edit” for each field of your form in order to keep the timer in check for real live activity and not just record selection.

Reply With Quote
  #4 (permalink)  
Resident Curmudgeon
Join Date: Feb 2004
Location: In front of the computer
Posts: 14,810
A simpler option might be to set a "drop dead" time to "x minutes from now" every time that the user "does something of interest". Then you only need one routine to set the "drop dead" time (which can be called from everywhere), and one event to check and see if the "drop dead" time has past and take the appropriate action.

For most of the applications that I've seen, logout is pretty simple. If that doesn't work easily, you could always exit from the program (drastic, but effective).

In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #5 (permalink)  
Registered User
Join Date: Jan 2012
Posts: 81
Thanks guys! Will see what works best!
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On