Open Exclusively

G

Guest

I have 2 question's.
Is there a way to find out all users that have a database open.
You know if you try and Compact Repair or open a DB in Exclusive mode is
shows the name of a user that has it open. Is there somewhere I can see "all"
users that have it open?
My other question is, in the past, I've tried to open a DB Exclusivley and I
get a pop up that says this DB is already opened exclusively and it shows my
ID as the person with it opened exclusively? How can that be?

Thanks
 
G

Guest

To see who's logged in you can look at the ldb file that gets created when
the database is access. You can also use the 'Who's logged on for Access 97'
(it works on 2000 and 2003 as well) sample database found at
http://www.groupacg.com/

When you got that message, are you sure you didn't already have a copy of
the database open?

Daniel
 
G

George Nicholson

1st question: one solution would be to add a UsageLog table to the db. 3
fields: Username, UserTime and UserAction. When opened, log a record with
UserName, Date/Time and "Log In". Same idea when closing (except "Log Out").

Build a query that shows Max(UserTime) and UserName from the log. In another
query, attach the LastAction result to the usage table by Timestamp &
Username, then add the associated action. Result should be a list of all
users & what their very last action was. Anyone with an action other than
"Log Out" is either still in or terminated abnormally.

You can of course log other actions to this table as well (Using advanced
features, supplying an internal password, failing to provide said password,
etc.)

This log has come in handy more than once. In one case, a client called me
in because the db had become corrupt. Looking at the UserLog, I noticed that
the last person in before corruption had never logged out (i.e., an abnormal
termination). Looking further, this user had a LOT of abnormal terminations.
When asked, he reported that the app was hanging every time he tried a
specific action, so he bailed out. I was able to recreate & fix the problem
(an pretty much endless loop under certain conditions) but i wouldn't have
even have known to ask him without the log. (Had he reported the problem to
anyone? Of course not...)

http://mvps.org/access/api/api0008.htm has code to retrieve the current
network (i.e., Windows) user name.

2nd question: probably the .ldb file wasn't deleted after the last user
logged out. As long as the .ldb file exists, you won't be able to open
exclusively since its mere presence tells Access that the mdb is already in
use (it doesn't care by whom at this point). Also, I believe the ldb file is
"owned" by whoever created it (i.e., the first user) until it is destroyed
by the last person logging out (even if the original "opener" logged out &
went home hours ago). Might be wrong about that, but that's my
understanding.

HTH
 

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

Top