Autoclose Access Database if not using for more than a certain period

  • Thread starter Thread starter xiaodan86
  • Start date Start date
X

xiaodan86

My Access database is working in a multi-user environment.
Is there any function to close the access database if the user is not
using the file for more than 2 hours?
Thanks.
 
My Access database is working in a multi-user environment.
Is there any function to close the access database if the user is not
using the file for more than 2 hours?

To add to B Edwards response

HOW TO: Detect User Idle Time or Inactivity in Access 2000 (Q210297)
http://support.microsoft.com/?kbid=210297
ACC: How to Detect User Idle Time or Inactivity (Q128814)
http://support.microsoft.com/?kbid=128814

However we found that the code which runs on the timer event must be
disabled for the programmers. Otherwise weird things start happening
when you're editing code.

Also print preview would sometimes not allow the users to run a menu
item to export the report to Excel or others. So you had to right
click on the Previewed report to get some type of internal focus back
on the report so they could then export it. This was also helped by
extending the timer to five minutes.

The downside to extending the timer to five minutes was if a person
stays in the same form and at the same control for considerable parts
of the day, ie someone doing the same inquiries, the routine didn't
realize that they had actually done something. I'll be putting in
some logic sometime to reset this timer whenever they do something in
the program.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Thanks so much for helping me.
I try on the code which show on http://support.microsoft.com/?kbid=128814
It works Ok. But I cannot include procedure(1). If I include the
procedure(1), A prompt box will show after one minutes if no activity
detected. The program will no close until the user press the Ok
button. So I just include procedure(2). I intend to set the time
interval to 3600,000 which is equal to one hour. Will there be any
problem?

(1)
Sub IdleTimeDetected (ExpiredMinutes)
Dim Msg As String
Msg = "No user activity detected in the last "
Msg = Msg & ExpiredMinutes & " minute(s)!"
MsgBox Msg, 48
End Sub

(2)

Sub IdleTimeDetected (ExpiredMinutes)
Application.Quit A_SAVE
End Sub
 
this isn't possible

it is just a symptom that MDB is not a good solution for your needs.

I would reccomend moving to a real database like SQL Sever

Access Data Projects are the most wonderful environment in the world
 
yeah but what if someone has macros disabled? rofl

I'd reccomend using a real database that is safe to backup WHILE
PEOPLE ARE USING IT

anything else is a CON
 
Back
Top