RecordSet.MoveNext
From Xojo Documentation
This item was deprecated in version 2019r2. Please use RowSet.MoveToNextRow as a replacement. |
Method
Moves to the next record/row in the RecordSet. After the last row, RecordSet.EOF is True.
Examples
The following method populates a ListBox with a RecordSet. It uses the Name and StringValue properties to obtain the fieldnames and values:
Sub PopulateListBox(dataList As Listbox, rs As RecordSet)
If rs Is Nil Then Return
// set up listbox state for population
dataList.DeleteAllRows
dataList.Columncount = rs.Fieldcount
// Add the DB columns as the heades for the ListBox
dataList.ColumnCount = rs.FieldCount
dataList.Column(-1).WidthExpression = "100"
For i As Integer = 0 To rs.FieldCount - 1
dataList.Heading(i) = rs.IdxField(i + 1).Name
Next
// Add the data from the table
While Not rs.EOF
dataList.AddRow("")
For i As Integer = 0 To rs.FieldCount - 1
dataList.Cell(dataList.LastIndex, i) = rs.IdxField(i + 1).StringValue
Next
rs.MoveNext
Wend
rs.Close
End Sub
If rs Is Nil Then Return
// set up listbox state for population
dataList.DeleteAllRows
dataList.Columncount = rs.Fieldcount
// Add the DB columns as the heades for the ListBox
dataList.ColumnCount = rs.FieldCount
dataList.Column(-1).WidthExpression = "100"
For i As Integer = 0 To rs.FieldCount - 1
dataList.Heading(i) = rs.IdxField(i + 1).Name
Next
// Add the data from the table
While Not rs.EOF
dataList.AddRow("")
For i As Integer = 0 To rs.FieldCount - 1
dataList.Cell(dataList.LastIndex, i) = rs.IdxField(i + 1).StringValue
Next
rs.MoveNext
Wend
rs.Close
End Sub