xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

NetRecLock()

Locks the current record for write access.

Syntax

NetRecLock( [<nSeconds>] ) --> lSuccess

Arguments

<nSeconds>
Optionally, a numeric value can be passed specifying the amount of seconds to retry the operation before the function returns without success. It defaults to the return value of SetNetDelay().

Return

The function returns .T. (true) when the current database record is successfully locked, otherwise .F. (false) is returned.

Description

NetRecLock() is a network function used to obtain a lock on the current database record when the database file is open in shared mode for multi-user access. If the current database record cannot be locked due to the record being locked by another process, the function retries the operation for a maximum of <nSeconds> seconds and prompts the user if the operation should be retried or aborted.

The function uses DbRLock() and implements additional default logic for record locking in a network when the record cannot be locked at the moment. Refer to DbRLock() for more information on locking a database record.

Note:  call function DbRUnlock(), DbUnlock() or DbUnlockAll() to release the record lock after data is written to the current record.

Info

See also:DbRLockList(), DbRUnlock(), DbUnlock(), DbUnlockAll(), NetFileLock(), RLock(), UNLOCK
Category: Database functions , Network functions , xHarbour extensions
Source:rtl\ttable.prg
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe