|
<< Click to Display Table of Contents >> DbiAppendRecord |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiAppendRecord (hCursor, pRecBuf);
Delphi syntax
function DbiAppendRecord (hCursor: hDBICur; pRecBuff: Pointer): DBIResult stdcall;
Description
DbiAppendRecord appends a record to the end of the table associated with the cursor.
Parameters
hCursor Type: hDBICur (Input)
Specifies the cursor handle to the table to which the record is being appended.
pRecBuf Type: pBYTE (Input)
Specifies the pointer to the record buffer.
Usage
The contents of the current record buffer are appended. This function is equivalent to calling DbiSetToEnd followed by DbiInsertRecord.
dBASE, FoxPro, and Access: This function behaves the same as DbiInsertRecord.
Paradox: For tables with a primary index, where physical reordering of records is forced, DbiAppendRecord is equivalent to DbiInsertRecord. If referential integrity or validity checks are applied to the Paradox table, the data is verified prior to appending the record. If any of the checks fail, an error is returned and the operation is not completed.
SQL: This function behaves the same as DbiInsertRecord.
Prerequisites
A valid cursor handle must be obtained. Other users cannot have a write lock on the table. The record buffer should be initialized with DbiInitRecord, and data filled in using DbiPutField.
Completion state
This function leaves the cursor positioned on the inserted record. If there is an active range and the inserted record falls outside the range, the cursor might be positioned at the beginning or end of the file.
DbiResult |
Meaning |
DBIERR_NONE |
The data was successfully appended. |
DBIERR_INVALIDHNDL |
The specified cursor is invalid or NULL. |
DBIERR_INVALIDPARAM |
The record buffer is NULL. |
DBIERR_KEYVIOL |
The table has a unique index and the inserted key value conflicts with an existing record's key value. |
DBIERR_FOREIGNKEYERR |
A linking field value does not exist in the corresponding master table (Paradox only). |
DBIERR_MINVALERR |
The specified data is less than the required minimum value. |
DBIERR_MAXVALERR |
The specified data is greater than the required maximum value. |
DBIERR_LOOKUPTABLEERR |
One or more of the fields in the record buffer have failed an existing validity check (Paradox only). |
DBIERR_REQDERR |
A required field in the record buffer was left blank (not applicable to dBASE or FoxPro). |
DBIERR_TABLEREADONLY |
Table access denied; the cursor does not have write access to the table. |
DBIERR_NOTSUFFTABLERIGHTS |
Insufficient table rights to append a record (Paradox only). |
DBIERR_NOTSUFFSQLRIGHTS |
Insufficient SQL rights for operation. |
DBIERR_NODISKSPACE |
The record cannot be appended because there is insufficient disk space. |
See also
DbiGetNextRecord, DbiGetPriorRecord, DbiGetRecord, DbiGetCursorProps, DbiGetRelativeRecord, DbiOpenTable, DbiInitRecord, DbiPutBlob, DbiPutField, DbiVerifyField
For SQL-related restrictions, see DbiInsertRecord.