Board index » delphi » Record locking ? how can I do that ?

Record locking ? how can I do that ?

I'm quite new to Delphi Database programming and maybe this is a
stupid question.

Does anyone have a rough idea how to do this:

I have a TTable connected to a InterBase database.

I wish that when a TTable.Edit is performed on a row from that table
(automatically by a TDBGrid !) the row is locked so that no other user
can read it. (ie by performing another TTable.Edit on it)

I also wish to check whether a row is locked or not to issue the user
a message stating someone else is editing it.

Any help will be very appreciate :-))

Thank you in advance.

 

Re:Record locking ? how can I do that ?


Quote
pborm...@mbox.vol.it (Paolo Bormida) wrote:
>I'm quite new to Delphi Database programming and maybe this is a
>stupid question.
>Does anyone have a rough idea how to do this:
>I have a TTable connected to a InterBase database.
>I wish that when a TTable.Edit is performed on a row from that table
>(automatically by a TDBGrid !) the row is locked so that no other user
>can read it. (ie by performing another TTable.Edit on it)

I don't use Interbase, but the above is true.

Quote
>I also wish to check whether a row is locked or not to issue the user
>a message stating someone else is editing it.

To check a lock condition you can use direct BDE calls. It works for
local database (i.e. Paradox),  i don't know for SQL servers (is there
a Interbase statement to do it??)
Anyhow, the BDE alreadyl raise an exception and display a message box
with the name of the user who locked the record if you try to edit it
twince.

Quote
>Thank you in advance.

Non c' di che,
Spero che ti serva,
        Corrado

Corrado Labinaz        
Vicenza (Italy)
internet:  c...@gpnet.it
fidonet:   2:333/209.6

Other Threads