|
<< Click to Display Table of Contents >> DbiLinkDetailToExp |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiLinkDetailToExp (hCursorMstr, hCursorDetl, iKeyLen, pszMstrExp);
Delphi syntax
function DbiLinkDetailToExp (hCursorMstr: hDBICur; hCursorDetl: hDBICur; iKeyLen: Word; pszMstrExp: PChar): DBIResult stdcall;
Description
DbiLinkDetailToExp links the detail cursor to the master cursor using a dBASE expression.
Parameters
hCursorMstr Type: hDBICur (Input)
Specifies the cursor handle associated with the master table. Must be a cursor on a dBASE table. The cursor does not have to be opened on an index.
hCursorDetl Type: hDBICur (Input)
Specifies the cursor handle associated with the detail table. The cursor must be ordered on an index corresponding to the provided expression, and the cursor must be open on a dBASE table.
iKeyLen Type: UINT16 (Input)
Specifies the length of the key to match.
pszMstrExp Type: pCHAR (Input)
Pointer to the expression string. Must be a valid dBASE expression whose key type is the same as the active index of the detail table.
Usage
This function is supported by the dBASE driver only.
dBASE and FoxPro: This function is used to establish one-to-many or one-to-one relationships, using expressions. This function is used to create linked cursors so that the master cursor is on a dBASE table and the link is a dBASE-style expression, not a set of fields.
Prerequisites
hCursorMstr and hCursorDetl must be link cursors. This is done by calling DbiBeginLinkMode for both master and detail cursor. For the tables to be linked, both cursor handles must be obtained on a dBASE or FoxPro table.
Completion state
The linked cursors are set up such that the detail cursor shows only records that match the linking value of the master record.
DbiResult |
Meaning |
DBIERR_NONE |
The specified detail cursor was successfully linked to the specified master cursor. |
DBIERR_INVALIDHNDL |
One or more of the specified cursor handles is invalid or NULL. |
DBIERR_INVALIDLINKEXPR |
The expression used was invalid. |
See also