RecordSet
Class RecordSet

Method PrototypeDescription
Function BOF() As BooleanIndicates the RecordSet is at the Beginning
Sub Close()Closes the RecordSet
Function ColumnType( Index As Integer ) As IntegerReturns an integer that specifies the Data Type of the specified column. Index is 1-based.
Sub DeleteRecord()Deletes current row in the RecordSet
Sub Edit()Puts the RecordSet into "edit mode" so that you can change its column values
Function EOF() As BooleanIndicates the end of the RecordSet has been reached
Function Field( Name As String ) As DatabaseFieldReturns a database field for the specified column name.
Function FieldCount() As IntegerGets the number of fields in the set.
Function IdxField( Index As Integer ) As DatabaseFieldIndex is 1-based. Returns a DatabaseField for the specified column position.
Sub MoveFirst()Moves the RecordSet to the first row. This only works with SQLiteDatabase.
Sub MoveLast()Moves the RecordSet to the last row. This only works with SQLiteDatabase.
Sub MoveNext()Moves the RecordSet to the next row.
Sub MovePrevious()Moves the RecordSet to the previous row. This only works with SQLiteDatabase.
Function RecordCount() As IntegerReturns the number of rows in the RecordSet. Only supported for SQLiteDatabase and PostgreSQLDatabase. Other databases return -1.
Sub Update()Saves any changes made to the RecordSet (after using Edit) back to the database


You cannot create your own RecordSets using the New operator. Instances of RecordSets are created only by Database.SQLSelect.

Example:

// Showing the first column from a query
Dim query As String = "SELECT * FROM myTable"
Dim results As RecordSet

results = myDB.SQLSelect(query)

If results <> Nil Then
    While Not results.EOF
        Print results.IdxField(1).StringValue
        results.MoveNext
    Wend
    results.Close
End If