Who has Record Locked??

G

Greg F.

Is there a way to to tell who has a record locked?
Can it be read from the LDB file?

I am using FE/BE DB.

Thanks,
Greg
 
6

'69 Camaro

Hi, Greg.
Is there a way to to tell who has a record locked?

Jet handles internally which user has each record locked. It's a
proprietary architecture, so you won't be able to find out unless you want
to read the binary file and can decipher it.

However, you can always check who's logged into the database, and from there
try to narrow it down logically. ("It's not Pat, because she's in a
meeting, so it must be Jerry, because he's the only other employee logged
into this database right now," which isn't as reliable as it sounds because
Pat could have been editing a record before she left her office.) So you're
pretty much in the dark, other than being able to tell who the likely
suspects are.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
G

Greg F.

Thanks! That's what I was afraid of.

So in order for me to get that detailed would require me to create a routine
that would capture the current user name and current record number in a
table and have it update that table accordingly?

Then I could just check that "lock" table to see what user name has a record
locked.

Thanks Again!

Greg
 
G

Guest

You know, you COULD code something up in VBA that would give you an
approximation of what you want. Kludgy as the following is, it does represent
a way to know who's dealing with specific records at a given time.

You create a table. In this table you have fields for USER, TABLENAME and
RECORDKEY. Whenever a user pulls upa specific record, your VBA code writes a
record to that table. When they leave that record (either exiting Access or
moving on to another record), that table entry is removed. Then YOU (as DBA)
can read that table, and get pretty much a real-time snapshot of who has what
"in progress".

Yes I KNOW it's kludgy, but it depends on how badly you need the information.
 
6

'69 Camaro

Hi, Greg.
So in order for me to get that detailed would require me to create a
routine that would capture the current user name and current record number
in a table and have it update that table accordingly?

Yes, but your code isn't going to be 100% reliable, because you can't
guarantee that the code always executes when it should when the database is
closed down unexpectedly, the network connection is lost, or the workstation
loses power.
Then I could just check that "lock" table to see what user name has a
record locked.

Yes, but the database engine does this record-locking record keeping anyway,
and a lot more efficiently than you can via VBA. What are you trying to
accomplish? It's not like knowing Joe has a record locked will allow Mike
to do his edits on that same record any faster.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
G

Greg F.

See below...

'69 Camaro said:
Hi, Greg.


Yes, but your code isn't going to be 100% reliable, because you can't
guarantee that the code always executes when it should when the database
is closed down unexpectedly, the network connection is lost, or the
workstation loses power.

True, very true.
Yes, but the database engine does this record-locking record keeping
anyway, and a lot more efficiently than you can via VBA. What are you
trying to accomplish? It's not like knowing Joe has a record locked will
allow Mike to do his edits on that same record any faster.

Well, yes it could, especialy if Joe doesn't realize that he left the DB
open and is camping out on a record that Mike needs to update. If Mike could
look at a form and see that Joe has the record locked that he needs he can
try to contact Joe to tell him to get out. or if Joe walked away, Mike
could go to Joe's PC and get him out of the record.

Another way around this would be to build in an inactivity timer that would
close the form of left idle too long.
 
6

'69 Camaro

Hi, Greg.
or if Joe walked away, Mike could go to Joe's PC and get him out of the
record.

Every place I've worked, anyone caught leaving a workstation unsecured would
be fired. Password-protected screensavers would prevent Mike from doing
anything on Joe's workstation.
Another way around this would be to build in an inactivity timer that
would close the form of left idle too long.

This is the most common method for "squatters." Kick 'em out. ;-)

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

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