Board index » delphi » Detecting a Lock record (not a lock table but the record)

Detecting a Lock record (not a lock table but the record)

I need to be able to detect if a specific record contain in a database is
currently locked or if i actually can write in it

What i want to do is to hold modifications unto a record that is locked by
another user until it unlock and became accessible again..

Is there a property like TTable.RecordLocked or something like that??

Thanks,
 Mike

 

Re:Detecting a Lock record (not a lock table but the record)


In article <oHeR5.1260$Bm.16...@news.globetrotter.net>, "Michel Hudon"

Quote
<Kai...@-NOSPAM-hotmail.com> writes:
>I need to be able to detect if a specific record contain in a database is
>currently locked or if i actually can write in it

>What i want to do is to hold modifications unto a record that is locked by
>another user until it unlock and became accessible again..

>Is there a property like TTable.RecordLocked or something like that??

No, but there is a BDE API call - dbiIsRecordLocked. BDE API Help might give
you sufficient detail, or you might need some example code, which is not in my
skills at this time <g>

Alan Lloyd
alangll...@aol.com

Re:Detecting a Lock record (not a lock table but the record)


Quote
"Michel Hudon" <Kai...@-NOSPAM-hotmail.com> wrote in message

news:oHeR5.1260$Bm.16917@news.globetrotter.net...

Quote
> I need to be able to detect if a specific record contain in a database is
> currently locked or if i actually can write in it

> What i want to do is to hold modifications unto a record that is locked by
> another user until it unlock and became accessible again..

> Is there a property like TTable.RecordLocked or something like that??

If you don't want to use a direct BDE call you can use a try/except block:

try
    aTable.Edit
except
    on e : eDBEngineError do ShowMessage (e.Message);
    end;
if aTable.State = dsEdit
then // record isn't locked

Re:Detecting a Lock record (not a lock table but the record)


Quote
AlanGLLoyd (alangll...@aol.com) wrote:

: In article <oHeR5.1260$Bm.16...@news.globetrotter.net>, "Michel Hudon"
Quote
: <Kai...@-NOSPAM-hotmail.com> writes:

: >Is there a property like TTable.RecordLocked or something like that??

: No, but there is a BDE API call - dbiIsRecordLocked. BDE API Help might give
: you sufficient detail, or you might need some example code, which is not in my
: skills at this time <g>

It's not something I've coded either, but I know there is sample code
for all the BDE APIs at Borland's website.  They've been moving the
pages around; the old location was http://www.borland.com/devsupport/bde/delphi/
--
Rick Carter
carte...@email.uc.edu

Other Threads