Click or drag to resize

DbUnLockAll Function

Release all locks for all work areas.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.3b
Syntax
 FUNCTION DbUnLockAll() AS LOGIC
View Source

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
DbUnLockAll() releases any record or file locks obtained by the current process for any work area.   DbUnLockAll() is only meaningful on a shared database.
It is equivalent to calling DBUnlock() on every occupied work area.
Examples
The following example marks a record for deletion if an RLock() attempt is successful, then clears all locks in all work areas:
X#
 1cLast := "Winston"
 2USE sales SHARED NEW VIA "DBFNTX"
 3Sales->DBSetIndex("salefnam")
 4Sales->DBSetIndex("salelnam")
 5USE colls SHARED NEW VIA "DBFNTX"
 6Colls->DBSetIndex("collfnam")
 7Colls->DBSetIndex("colllnam")
 8IF Colls->DBSeek(cLast)
 9    IF Colls->Deleted()
10        QOut("Record deleted: ", Colls->Deleted())
11        IF Colls->RLock()
12            Colls->DBRecall()
13            QOut("Record recalled...")
14        ENDIF
15    ENDIF
16ELSE
17    QOut("Not found")
18    DbUnLockAll()            // Remove all locks in
19ENDIF                        // all work areas
See Also