Snapshot-Type Recordset Example

This example opens a snapshot-type Recordset and demonstrates its read-only characteristics.

Sub dbOpenSnapshotX()

    Dim dbsNorthwind As Database
    Dim rstEmployees As Recordset
    Dim prpLoop As Property

    Set dbsNorthwind = OpenDatabase("Northwind.mdb")
    Set rstEmployees = _
        dbsNorthwind.OpenRecordset("Employees", _
        dbOpenSnapshot)

    With rstEmployees
        Debug.Print "Snapshot-type recordset: " & _
            .Name

        ' Enumerate the Properties collection of the
        ' snapshot-type Recordset object, trapping for
        ' any properties whose values are invalid in 
        ' this context.
        For Each prpLoop In .Properties
            On Error Resume Next
            Debug.Print "  " & _
                prpLoop.Name & " = " & prpLoop
            On Error Goto 0
        Next prpLoop

        .Close
    End With

    dbsNorthwind.Close

End Sub