dbGetField()

Database function which reads a column (field) of the current data record.

Synopsis

int dbGetField(dbRecordset recordset, int index, anytype &field);

Parameters

Parameter Meaning
record set Record set reference
index Column number of the field, the first column having index 0.
field Variable which is to hold the contents of the field pointed to

Return Value

The return value is an error code; 0 indicates the operation has been performed successfully. For other values dbGetError() can be used to obtain detailed error information.

Errors

An error is returned if an invalid record set reference variable is passed, for an invalid column index, or if the field variable cannot be used.

Description

The contents of the current data record are read using dbGetField(). Please refer to the ADO manual for possible data types.

NULL values in the database (value not known) are returned as an empty string. Unknown data types are returned as string "N/A" ("not available").

Example

see dbOpenRecordset()

Assignment

ADO and Qt, Database functions

Availability

CTRL