Forward-Only – Type Recordset Object

Description

This Recordset type is identical to a snapshot except that you can only scroll forward through its records. This improves performance in situations where you only need to make a single pass through a result set.

In an ODBCDirect workspace, this type corresponds to an ODBC forward-only cursor.

Properties

BatchCollisionCount property, BatchCollisions property, BatchSize property, BOF, EOF properties, Connection property, EditMode property, Filter property, Name property, RecordCount property, RecordStatus property, Restartable property, StillExecuting property, Transactions property, Updatable property, UpdateOptions property, ValidationRule property, ValidationText property.

Methods

AddNew method, Cancel method, CancelUpdate method, Close method, CopyQueryDef method, Delete method, Edit method, GetRows method, Move method, MoveFirst, MoveLast, MoveNext, MovePrevious methods, NextRecordset method, Requery method, Update method.

See Also

Dynaset-Type Recordset object, Recordset object, Snapshot-Type Recordset object, Table-Type Recordset object.

Example

This example opens a forward-only-type Recordset, demonstrates its read-only characteristics, and steps through the Recordset with the MoveNext method.

Sub dbOpenForwardOnlyX()

    Dim dbsNorthwind As Database
    Dim rstEmployees As Recordset
    Dim fldLoop As Field

    Set dbsNorthwind = OpenDatabase("Northwind.mdb")
    ' Open a forward-only-type Recordset object. Only the
    ' MoveNext and Move methods may be used to navigate
    ' through the recordset.
    Set rstEmployees = _
        dbsNorthwind.OpenRecordset("Employees", _
        dbOpenForwardOnly)

    With rstEmployees
        Debug.Print "Forward-only-type recordset: " & _
            .Name & ", Updatable = " & .Updatable

        Debug.Print "    Field - DataUpdatable"
        ' Enumerate Fields collection, printing the Name and
        ' DataUpdatable properties of each Field object.
        For Each fldLoop In .Fields
            Debug.Print "        " & _
                fldLoop.Name & " - " & fldLoop.DataUpdatable
        Next fldLoop

        Debug.Print "    Data"
        ' Enumerate the recordset.
        Do While Not .EOF
            Debug.Print "        " & !FirstName & " " & _
                !LastName
            .MoveNext
        Loop

        .Close
    End With

    dbsNorthwind.Close

End Sub