|
<< Click to Display Table of Contents >> DbiOpenRef |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiOpenRef (hDBICur hCursor, UINT16 iField, BOOL bReadOnly, BOOL bUniDirectional, phDBICur phCursor);
Delphi syntax
function DbiOpenRef(hCursor: hDBICur; iFieldNo: Word; bReadOnly: Bool; bUniDirectional: Bool; var hRefCursor: hDBICur): DBIResult; stdcall;
Description
DbiOpenRef creates a new cursor for the REF field.
Parameters
hCursor Type: hDBICur (Input)
Specifies the cursor handle of the parent cursor.
iField Type: UNINT16 (Input)
Specifies the ordinal number of the REF field within the record buffer.
bReadOnly BOOL (Input)
If True, the REF field is opened in dbiREADONLY mode and cannot be modified.
bUniDirectional BOOL (Input)
TRUE if this cursor is unidirectional (SQL only).
phCursor phDBICur (Output)
Pointer to the cursor handle for the REF.
Prerequisites
Parent cursor must be opened by a DbiOpenTable or by executing a query.
DbiResult |
Meaning |
DBIERR_NONE |
The REF was opened successfully. |
DBIERR_NA |
The iField specified is not a REF field. |
| Note: | When inserting records with a cursor opened with DbiOpenRef, the BDE needs to know the name of the stand-alone table into which to insert the record. If this property has not been set, an error will occur. |
DbiSetProp( hCur, curREFINSERTTABLENAME, (UINT32)
<pszStandAloneTableName> );
| Note: | After inserting a record, the object ID for the newly inserted record can be obtained by allocating space (the iLen of the parent's REF field), and passing this into DbiGetProp. |
DbiSetProp( hCur, curREFINSERTTABLENAME, (UINT32)
<pszStandAloneTableName> );
See also