DbiOpenIndex

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiOpenIndex

Return to chapter overview

C syntax

DBIResult DBIFN DbiOpenIndex (hCursor, pszIndexName, iIndexId);

Delphi syntax

function DbiOpenIndex (hCursor: hDBICur; pszIndexName: PChar; iIndexId: Word): DBIResult stdcall;

Description

DbiOpenIndex opens the specified index or indexes for the table associated with the cursor.

Parameters

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

pszIndexName                Type: pCHAR                (Input)
Pointer to the index name.

iIndexId                Type: UINT16                (Input)
Specifies the index number. Used only with Paradox and Access tables.

Usage

dBASE and FoxPro: This function is used to open non-production dBASE and FoxPro indexes. The open index is maintained, but only in the context of this cursor. That is, only updates applied during the use of this cursor maintain the index. If the index is an .MDX or .CDX index, all tags in that index are opened and maintained.

Paradox: This function can be used only to verify that the specified index exists; it does not open the index. If the index does not exist, an error is returned. With Paradox tables, indexes are automatically opened when the table is opened.

Prerequisites

A valid cursor must be obtained, and the index must exist.

Completion state

DbiOpenIndex does not alter the current record order of the result set or the currency of the cursor. To change the current index order, use DbiSwitchToIndex.

DbiResult

Meaning

DBIERR_NONE

The index was successfully opened on a dBASE table; the index exists on a Paradox table.

DBIERR_INVALIDHNDL

The specified handle is invalid or NULL.

DBIERR_INDEXOPEN

The index is already opened, either implicitly or explicitly.

DBIERR_NOSUCHINDEX

No such index exists for the table.

See also

DbiAddIndex, DbiCloseIndex, DbiSwitchToIndex