|
LockRecord() 
Locks the currently selected record or records in
the current or specified database.
Syntax
LockRecord([<lAll>]) --> lResult
Arguments
<lAll> --> You may optionally pass TRUE
to this function to attempt to lock all records within the
specified table. If FALSE is passed or this parameter omitted, this
function will only attempt to lock the currently pointed to
record.
Returns
Returns TRUE if the record was successfully
locked, otherwise FALSE.
Description
LockRecord() is a network function that locks the
current record or all records of a table, preventing other users
from updating the record or records until the lock is released. The
record can still be read by other users. A record lock remains
until another record is locked, or the UnlockRecord() function is
called for the same record or the database table is closed.
For each invocation of LockRecord(), there is one
attempt to lock the current record, and the result is returned as a
TRUE or FALSE value. An attempt to obtain a record lock fails if
another user or application has already locked the record. An
attempt to lock all records will fail if any record is already
locked by another user.
It is recommended that you always specify which
table to lock. See the example below:
If
Table->(LockRecord())
Echo("The selected record is
locked.")
Endif
Table->(UnlockRecord())
You do not need to
use record locking to write data to CAPITAL's databases using the
Write()
function. The record will automatically be locked for the duration
of the write.
When you have finished writing to the
record you must unlock it using the
UnlockRecord() function. Other users on your
network may be prevented from working on the data contained in the
database until you unlock it.
____________________________
Related Topics
Business
Function List
UnlockRecord()
|