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.08
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#
cLast := "Winston"
USE sales SHARED NEW VIA "DBFNTX"
Sales->DBSetIndex("salefnam")
Sales->DBSetIndex("salelnam")
USE colls SHARED NEW VIA "DBFNTX"
Colls->DBSetIndex("collfnam")
Colls->DBSetIndex("colllnam")
IF Colls->DBSeek(cLast)
        IF Colls->Deleted()
                QOut("Record deleted: ", Colls->Deleted())
                IF Colls->RLock()
                        Colls->DBRecall()
                        QOut("Record recalled...")
                ENDIF
        ENDIF
ELSE
        QOut("Not found")
        DBUnlockAll()                        // Remove all locks in
ENDIF                                                // all work areas
See Also