Board index » delphi » how to test a table is lock or not ?

how to test a table is lock or not ?

Hi my name is Ivan, I am studying delphi language.
I want to make a multiuser program using delphi table.\
I use Paradox database.
I want to know how to test a table is lock or not, so I can write a code
that loop and check the table is lock or not. The loop ended when the
table is unlock or not lock.
I know how to lock and unlock a table, but I don't know how to test a
table is lock or not.
Anybody can help me ??? :) Please let me know :)

Thank's a lot :
Ivan
Iva...@elang.stts.ac.id

 

Re:how to test a table is lock or not ?


Hi !

The most common type of locking is a row lock, which is applied by a user
editing the record.
You could do something like this to test wether a locking is apparent on
Table1:

uses
  BDE

try
  Table1.edit;
except
  on E:EDBEngineError do begin
    if E.Errors[0].Category = ERRCAT_LOCKCANFLICT then
      // do whatever you like to happen when a lock conflict occurs
  end;
end;
Table1.Cancel; // This cancels the edit mode...

Bjoerge Saether

Ivan Kurnia <iva...@elang.stts.ac.id> skrev i artikkelen
<362EE559.3...@elang.stts.ac.id>...

Quote
> Hi my name is Ivan, I am studying delphi language.
> I want to make a multiuser program using delphi table.\
> I use Paradox database.
> I want to know how to test a table is lock or not, so I can write a code
> that loop and check the table is lock or not. The loop ended when the
> table is unlock or not lock.
> I know how to lock and unlock a table, but I don't know how to test a
> table is lock or not.
> Anybody can help me ??? :) Please let me know :)

> Thank's a lot :
> Ivan
> Iva...@elang.stts.ac.id

Other Threads