LockRecord()


Locks the currently selected record in the current or specified database.

Syntax

LockRecord() --> lResult

Arguments

None.

Returns

Returns TRUE if the record was successfully locked, otherwise FALSE.

Description

LockRecord() is a network function that locks the current record, preventing other users from updating the record 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 file 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.

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())

generate/hint1.gifYou 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.

generate/mistake2.gifWhen 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()



CAPITAL VISUAL BUILDER