RecordSet
Class RecordSet
| Method Prototype | Description
|
| Function BOF() As Boolean | Indicates the RecordSet is at the Beginning
|
| Sub Close() | Closes the RecordSet
|
| Function ColumnType( Index As Integer ) As Integer | Returns 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 Boolean | Indicates the end of the RecordSet has been reached
|
| Function Field( Name As String ) As DatabaseField | Returns a database field for the specified column name.
|
| Function FieldCount() As Integer | Gets the number of fields in the set.
|
| Function IdxField( Index As Integer ) As DatabaseField | Index 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 Integer | Returns 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:
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