xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DbRUnlock()

Unlocks a record based on its indentifier.

Syntax

DbRUnlock( [<xRecno>] ) --> NIL

Arguments

<xRecno>
The parameter identifies a single record in a database. For DBF files, this is the numeric record number, as returned by Recno() for a particular record. If not specified, all active record locks are released.

Return

The return value is always NIL.

Description

The DbRUnlock() function releases a record lock for an individual record specified with <xRecno>. If no record identifier is passed to the function, DbRUnlock() bahaves like DbUnlock() since all active record locks are released.

Locking and unlocking one or more records for shared write access is the task of DbRlock() and DbRUnlock(), while RLock() works with the current record and DbUnlock() releases all locks.

Info

See also:DbRLock(), DbRLockList(), DbUnlock(), RLock(), UNLOCK
Category: Database functions , Network functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows a user defined function that accepts as
// parameter an array of record identifiers. These records are
// unlocked, unless the parameter is no array. In this case, all
// record locks are released.

   FUNCTION UnlockMultiple( xRecords )

      IF Valtype( xRecords ) == "A"
                                  // release individual locka
         AEval( xRecords, {|nRecno| DbRUnlock( nRecno ) } )
      ELSE
         DbRUnlock()              // release all locks
      ENDIF

   RETURN DbRLockList()           // return remaining locks

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