Click or drag to resize

DbServer.LockSelection Method

Lock all the records in the currently active selection.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.5
Syntax
 VIRTUAL METHOD LockSelection() AS USUAL

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.  If it fails, some records may remain locked; this allows the program to try again, incrementally locking more and more records as other applications free them.  If the application gives up on the attempt, the locks should be explicitly released.
Remarks
If a selection is not active, sends a NotifyIntentToMove message before the operation and functions the same as FLock().
Examples
A selective relation is set up between customer and order servers.  The application operates under "cursor stability" mode, which means that the currently active record remains locked and hence protected from outside influence.  When a customer record is locked, all the orders that correspond to that customer are also locked:
X#
1oDBCust := DBServer{"customer"}
2oDBOrder := DBServer{"order"}
3oDBOrder:SetIndex{("ORDCSTNO")
4oDBCust:SetSelectiveRelation(oDBOrder,#CustNo)
5...
6METHOD Skip() CLASS CustomerWindow
7oDBCust:Skip()                // Reposition order server
8oDBCust:RLock()            // Lock customer record
9oDBOrder:LockSelection()        // Lock order records
See Also