How can I tell who has my database open?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I hace a database that is used by several people. I would like to be able to
know who is logged into the program (which is on a server).

Thanks

david
 
So that if it gets left open I can contact the person to close it out if they
are through with it. I have gone in to make changes and upgrades only to
have to wait hours because it is already open somewhere else.
 
That's what I thought. As an alternative, you can program the application
to log the user off remotely (after a given grace period) or after a
specific period of inactivity.

On my website (www.rogersaccesslibrary.com), are two small Access database
samples called "LogUsersOff.mdb" and "LogUsersOffNonUse.mdb" which
illustrate how to do this.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Hi there!
I use a timer in my "main form" that after 2 hours displays the message "In
30 seconds application will terminate. Click on 'Cancel' to continue working".

Another way to easy check which computer is logged in your application is:
If your "server" isn't near you, connect to the "Server" PC (in which the
database is hosted) with a Remote Control program (like PCAnywhere) and check
in the "Computer Management-->System Tools-->Shared Folders-->Open Files"
section, if your database file is opened at this time and by who. You can
then call the PC-User and ask him to close the db.
Your "server" PC must have win2000 or xp installed...
John
 
Per JohnA:
I use a timer in my "main form" that after 2 hours displays the message "In
30 seconds application will terminate. Click on 'Cancel' to continue working".

I do the same thing in several apps except I make enabling of that part of the
timer contingent on the Timer() loop finding a certain .txt file. Then I load
the .txt file's contents into the "...application will terminate..." dialog.

It's handy for situations where users habitually leave the app up 24-7 and we
have to do something like an update or maintenance to the back end.
 
Hi Roger,

I would like to do something similar to your sample dbs, but rather than
inactivity or a looping timer, I would like to use the system time, as no
one is in the office after 7 PM and I have backups that start at 9 PM which
fail if the mdb file is open.

How difficult would it be to alter your code to use the actual time of day
rather than a timer?

TIA,

SusanV
 
And I guess that you put into the text file the number of remaining minutes,
so you can end the application everytime you wish. You can also set that if
the text file contains a zero (0), none of the users can open the database
(set 0 as the maitenance state)! Perfect! ;)
 
It should be quite easy to modify it to work with the system time. However,
I would still give them 10 minutes or so to close out before it shuts itself
down. While you may think no one is ever in the office after 7pm, that can
change. Best bet is to leave the grace period in. It can't hurt.

Now as for modifying my sample:

I haven't tested this, but if you changed this line:

If intLogoff = True Then...

in the Timer event of your form to:

If Time() > #7:00:00 PM# Then...

That should be the only modification you'll need.


--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Per JohnA:
And I guess that you put into the text file the number of remaining minutes,
so you can end the application everytime you wish. You can also set that if
the text file contains a zero (0), none of the users can open the database
(set 0 as the maitenance state)! Perfect! ;)

No, I never went that far - but it's an attractive idea except for the
formatting aspect it introduces.

I just use the text to explain the reason the app is going down. Something
like "We are doing a complete backup of the server this database resides on and
the backup software needs for the DB to be closed".

The "...application ending..." dialog has a "No, No - Keep It Open" button that
gives the user another 10 minutes each time the dialog pops and they click the
button. This is just CYA in case somebody is working late on something
critical.
 
(PeteCresswell) said:
Per JohnA:

No, I never went that far - but it's an attractive idea except for the
formatting aspect it introduces.

I just use the text to explain the reason the app is going down.
Something like "We are doing a complete backup of the server this
database resides on and the backup software needs for the DB to be
closed".

The "...application ending..." dialog has a "No, No - Keep It Open"
button that gives the user another 10 minutes each time the dialog
pops and they click the button. This is just CYA in case somebody
is working late on something critical.

You might STILL need a method to know who is in the app because if a user
leaves his PC with a modal form or dilaog up then no code you include is
going to be able to shut that instance of the app down. There are always
going be odd cases where you just have to pick up the phone or walk over
there to boot the user off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top