RecordSet.IdxField

From Xojo Documentation

Method

RecordSet.IdxField(Index as Integer) As DatabaseField

Supported for all project types and targets.

Returns a DatabaseField containing information about the column (specified by index, which is 1-based) from the current position in the RecordSet.

Notes

If the RecordSet has no rows, the returned DatabaseField only contains the Name of the column.

fa-info-circle-32.png
The IdxField method is 1-based, not 0-based.

Sample Code

Get the string value of a column in a RecordSet:

// rs is a RecordSet; column 1 (the first column) is a string column
Dim productName As String
productName = rs.IdxField(1).StringValue

Changes the string value of a column in a RecordSet:

// rs is a RecordSet; column 1 (the first column) is a string column
rs.Edit
rs.IdxField(1).StringValue = "Generic Widgets"
rs.Update