DbiOpenLockList

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiOpenLockList

Return to chapter overview

C syntax

DBIResult DBIFN DbiOpenLockList (hCursor, bAllUsers, bAllLockTypes, phLocks);

Delphi syntax

function DbiOpenLockList (hCursor: hDBICur; bAllUsers: Bool; bAllLockTypes: Bool; var hLocks: hDBICur): DBIResult stdcall;

Description

DbiOpenLockList creates an in-memory table containing a list of locks acquired on the table associated with hCursor.

Parameters

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

bAllUsers                Type: BOOL                (Input)
Specifies whether to list locks acquired in the current session only, or to list locks acquired by all sessions. For Paradox tables, bAllUsers can be either TRUE or FALSE. If bAllUsers is set to TRUE, users for all sessions are listed; if it is set to FALSE, only users for the current session are listed. For dBASE, FoxPro, and SQL tables, bAllUsers must be set to FALSE. For dBASE and FoxPro, only users for the current session are listed. For SQL, only locks for the current database connection are listed. Access does not support bAllUsers.

bAllLockTypes                Type: BOOL                (Input)
Specifies whether to include all locks of all types, or record locks only. If set to FALSE, only record locks are listed. If set to TRUE, locks of all types are listed.

phLocks                Type: phDBICur                (Output)
Pointer to the cursor handle of a table containting the list of locks.

Usage

Retrieve each table lock by using DbiGetNextRecord. After the record is retrieved, it can be cast with the LOCKDesc type definition.

Paradox: For Paradox tables, the locks on the table are returned, including those placed by the current session and those placed by other users, depending on the value of bAllUsers.

dBASE or FoxPro: For dBASE and FoxPro tables, only the locks placed by the current session are returned.

SQL: For SQL tables, only the locks placed by the current database connection are returned.

Prerequisites

A valid cursor handle must be obtained on a base table; this function is not applicable to query cursors or in-memory or temporary table cursors.

Completion state

The cursor is returned in phLocks. Lock types returned can include both table and record locks or only record locks, as specified in bAllLockTypes.

DbiResult

Meaning

DBIERR_NONE

The requested lock list was returned successfully.

DBIERR_INVALIDHNDL

The specified cursor handle is invalid or NULL, or phLocks is NULL.

See also

DbiOpenTable, DbiAcqTableLock, DbiAcqPersistTableLock