RecordSet.IdxField
From Xojo Documentation
This item was deprecated in version 2019r2. Please use RowSet.ColumnAt as a replacement. Note that IdxField is 1-based and ColumnAt is 0-based. |
Method
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.
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
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
rs.Edit
rs.IdxField(1).StringValue = "Generic Widgets"
rs.Update