Restartable Property Example

This example demonstrates the Restartable property with different Recordset objects.

Sub RestartableX()

    Dim dbsNorthwind As Database
    Dim rstTemp As Recordset

    Set dbsNorthwind = OpenDatabase("Northwind.mdb")

    With dbsNorthwind
        ' Open a table-type Recordset and print its 
        ' Restartable property.
        Set rstTemp = .OpenRecordset("Employees", dbOpenTable)
        Debug.Print _
            "Table-type recordset from Employees table"
        Debug.Print "  Restartable = " & rstTemp.Restartable
        rstTemp.Close

        ' Open a Recordset from an SQL statement and print its 
        ' Restartable property.
        Set rstTemp = _
            .OpenRecordset("SELECT * FROM Employees")
        Debug.Print "Recordset based on SQL statement"
        Debug.Print "  Restartable = " & rstTemp.Restartable
        rstTemp.Close

        ' Open a Recordset from a saved QueryDef object and 
        ' print its Restartable property.
        Set rstTemp = .OpenRecordset("Current Product List")
        Debug.Print _
            "Recordset based on permanent QueryDef (" & _
            rstTemp.Name & ")"
        Debug.Print "  Restartable = " & rstTemp.Restartable
        rstTemp.Close

        .Close
    End With

End Sub