DbiRelTableLock

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiRelTableLock

Return to chapter overview

C syntax

DBIResult DBIFN DbiRelTableLock (hCursor, bAll, eLockType);

Delphi syntax

function DbiRelTableLock (hCursor: hDBICur; bAll: Bool; eLockType: DBILockType): DBIResult stdcall;

Description

DbiRelTableLock releases table locks of the specified type associated with the session in which hCursor was created.

Parameters

hCursor                Type: hDBICur                (Input)
Specifies the cursor handle.

bAll                Type: BOOL                (Input)
Determines which table locks to release. If set to TRUE, all locks on the table associated with hCursor are released, and eLockType is ignored.

eLockType                Type: DBILockType                (Input)
Specifies the table lock type. eLockType is ignored if bAll is TRUE.

For dBASE, FoxPro, and SQL tables, dbiREADLOCK is upgraded to dbiWRITELOCK. In that case, if eLockType specifies dbiREADLOCK, the write lock is released.

Usage

Only locks acquired by calling DbiAcqTableLock can be released. A separate call to DbiRelTableLock is required to release each lock acquired by DbiAcqTableLock, if bAll is not set to TRUE.

dBASE or FoxPro: See the eLockType parameter description.

SQL: See the eLockType parameter description.

Prerequisites

There must be an existing table lock of the type specified in eLockType. However, an existing table lock is not required if all locks are being released (bAll is TRUE).

DbiResult

Meaning

DBIERR_NONE

Locks were successfully released.

DBIERR_INVALIDHNDL

The specified cursor handle is invalid or NULL.

DBIERR_NOTLOCKED

The table is not locked with the specified lock type (this error is returned only when bAll is FALSE).

See also

DbiAcqTableLock, DbiIsTableLocked, DbiOpenLockList