Access.2007.VBA.Bibl..

(John Hannent) #1
ErrorHandler:
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End Sub

Because other types of cursors are converted to keysets when you use optimistic locking for an ADO
recordset, you may as well specify the keyset cursor when you create the recordset, because that is
what you are going to get. See Table 5.6 for the details.

TABLE 5.6

ADO Recordset Cursor/Lock Type Combinations


Cursor Type Named Constant Lock Type Named Constant Available Methods


adOpenDynamic AdLockOptimistic AddNew
(converts to adOpenKeyset) Delete
Find
MoveFirst
MovePrevious
MoveNext
MoveLast
Update


adOpenDynamic adLockReadOnly Find
(converts to adOpenStatic) MoveFirst
MovePrevious
MoveNext
MoveLast


adOpenKeyset AdLockOptimistic AddNew
Delete
Find
MoveFirst
MovePrevious
MoveNext
MoveLast
Update


adOpenKeyset AdLockReadOnly Find
MoveFirst
MovePrevious
MoveNext
MoveLast


continued

Working with Access Data 5

Free download pdf