DbiVerifyField

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiVerifyField

Return to chapter overview

C syntax

DBIResult DBIFN DbiVerifyField (hCursor, iField, pSrc, [pbBlank]);

Delphi syntax

function DbiVerifyField (hCursor: hDBICur; iField: Word; pSrc: Pointer; var bBlank: Bool): DBIResult stdcall;

Description

DbiVerifyField verifies that the data specified in pSrc is a valid data type for the field specified by iField, and that all validity checks specified for the field are satisfied. It can also be used to check if a field is blank.

Parameters

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

iField                Type: UINT16                (Input)
Specifies the ordinal number of the field in the record.

pSrc                Type: pBYTE                (Input)
Pointer to the buffer containing the data to be verified. If NULL, the function verifies whether a blank value is allowed.

pbBlank                Type: pBOOL                (Output)
Pointer to the client variable that is set to TRUE if the field is blank; otherwise, it is set to FALSE.

Usage

If the translation mode of the cursor is xltFIELD, pSrc is assumed to contain field data in BDE logical format, otherwise it is considered to be the driver's physical format. The validity checking aspect of this function enables the client application to report errors without actually attempting to write the data. It can also be used to check if a field is blank. If pSrc is NULL, the function verifies whether or not a blank value is allowed.

DbiVerifyField is not supported with BLOB fields.

dBASE or FoxPro: For dBASE and FoxPro tables, this function can be used only to determine if a field is blank.

Paradox: For Paradox tables, this function evaluates field-level validity checks; it does not evaluate referential integrity constraints.

Completion state

If the field is blank, the variable pointed to by pbBlank is set to TRUE. If any field-level validity check has failed, an error message is returned, indicating which type of validity check the field has failed.

DbiResult

Meaning

DBIERR_NONE

The data meets all the requirements for the specified field.

DBIERR_MINVALERR

The data is less than the required minimum value.

DBIERR_MAXVALERR

The data is greater than the required maximum value.

DBIERR_REQDERR

The field cannot be blank.

DBIERR_LOOKUPTABLEERR

The value cannot be located in the assigned lookup table.

See also

DbiOpenTable, DbiPutField, DbiInsertRecord, DbiModifyRecord, DbiAppendRecord