Forced shutdown/inactivity shutdown

Status
Not open for further replies.

OpnSeason

New member
Local time
Today, 10:52
Joined
Mar 4, 2006
Messages
3
Hello Code Hungry Vultures!

This is a database demo complete with source. It illustrates how to force a shutdown or automatically shutdown from inactivity for a specified number of minutes.

This allows forcing users out for emergency maintenance such as compacting & repairing because of partial corruption or whatever, and inactivity shutdown for those who loiter in the database when off hours scheduled maintenance is needed such as compacting & repairing, or updates to tables, etc.

It is a front end database with a linked back end database.

On first opening Shutdown.mdb use the shift key to prevent the Autoexec macro from executing.

Then refresh the link for table MsgCenter in BACK_END.mdb.

The fields in the MsgCenter table:

ShowMsg----------Yes/No---Set this to True/Yes to force shutdown
MSG--------------Text-----Message to display in ShutdownMsg form
MsgBxTitlBar-----Text-----Titlebar caption to display in ShutdownMsg form
MaxInactiveTime--Integer--Max Inactivity Minutes
StartMonitor-----Integer--Time of day to start monitoring inactivity - 0 (12AM) to 24 (12PM)
EndMonitor-------Integer--Time of day to end monitoring inactivity - 0 (12AM) to 24 (12PM)


After link is refreshed either exit Shutdown.mdb and open again to run the autoexec macro or just run the autoexec macro without exiting.

Then open the MsgCenter table & click ShowMsg & close the table.
Forced shutdown will occur immediately.


For inactivity shutdown:

Open the MsgCenter table.

Change StartMonitor to an hour earlier than the current time.
Change EndMonitor to an hour later than the current time.

Set MaxInactiveTime to 1 (1 minute) and close the table.

Inactivity shutdown will occur in 1 minute.

OpnSeason :cool:
 

Attachments

Last edited:
Thank you for your post, however we have some 10 different posts on this subject
 
Thanks for your post OpnSeason!!!

Such is a very useful tool.

The code works on my db, except that.... (forgive my ignorance for i am an access novice) i don't know why the inactivity shutdown occurs immediately as soon as i open the form. I did exactly what you've stated on your post:

I open the MsgCenter table.

I changed StartMonitor to an hour earlier than the current time.
I change EndMonitor to an hour later than the current time.

Then, i set the MaxInactiveTime to 2minutes and close the table.

But, the countdown starts immediately at 20sec.

Where did i go wrong? :-(


Sheila
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom