Click or drag to resize

DbUnLock Function

Release all locks for a work area.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION DbUnLock() AS LOGIC
View Source

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
DBUnlock() releases any record or file locks obtained by the current process for a work area.  DBUnlock() is only meaningful on a shared database. By default, this function operates on the currently selected work area.  It can be made to operate on an unselected work area by specifying it within an aliased expression
Tip Tip
Shared mode: Releasing locks can cause updates to the database to become visible to other processes.  For more information, refer to "Concurrency Control" in the Programmer's Guide.
Examples
The following example illustrates a basic use of the DBUnlock() function:
X#
cLast := "Winston"
USE sales SHARED NEW VIA "DBFNTX"
Sales->DBSetIndex("lastname")
IF Sales->DBSeek(cLast)
        IF Sales->RLock()
                Sales->DBDelete()
                QOut("Record deleted: ", Sales->Deleted())
                Sales->DBUnlock()
        ELSE
                QOut("Unable to lock record...")
        ENDIF
ELSE
        QOut("Not found")
ENDIF
See Also