Resources

Supported ADO Cursor and Lock Type Combinations

The cursor and lock type combinations that are supported by the SAS Data Providers depend on whether the cursor is located on the client side or the server side. To view combinations for a specific location, see:

Note: If you request a combination that is not supported, the providers will attempt to use the supported combination that most closely matches your choice. Check the recordset after it is opened to see what cursor and lock type have been provided. For more details on how to use the various lock types discussed below see Implementing a Locking Strategy with the IOM and SAS/SHARE Providers .

Note: When specifying properties and cursor location on a recordset, the properties need to be specified after the cursor location is set. Certain properties can only be specified for the server. If the cursor location is specified after the properties, you may not see an error and you may have unexpected results. For more information, see the discussion of SAS customized properties in Known Issues.


Server-Side Cursor Combinations

To set a server-side cursor location, you can use this line of code:


obRecordset.CursorLocation = adUseServer

The following tables list the supported combinations for each provider, assuming a server-side cursor location:

Local Data Provider

Cursor Type Lock Type Supported Features
adOpenDynamic adLockReadOnly adBookmark, adFind, adHoldRecords, adMovePrevious
adOpenForwardOnly adLockReadOnly adFind, adHoldRecords

IOM Data Provider

Cursor Type Lock Type Supported Features
adOpenDynamic adLockBatchOptimistic adAddNew, adBookmark, adDelete, adFind, adHoldRecords, adMovePrevious, adUpdate, adUpdateBatch
adLockOptimistic adAddNew, adBookmark, adDelete, adFind, adHoldRecords, adMovePrevious, adUpdate, adUpdateBatch
adLockPessimistic adAddNew, adBookmark, adDelete, adFind, adHoldRecords, adMovePrevious, adUpdate, adUpdateBatch
adLockReadOnly adBookmark, adFind, adHoldRecords, adMovePrevious
adOpenForwardOnly adLockBatchOptimistic adAddNew, adDelete, adFind, adHoldRecords, adUpdate, adUpdateBatch
adLockOptimistic adAddNew, adDelete, adFind, adHoldRecords, adUpdate, adUpdateBatch
adLockPessimistic adAddNew, adDelete, adFind, adHoldRecords, adUpdate, adUpdateBatch
adLockReadOnly adFind, adHoldRecords

SAS/SHARE Data Provider

Cursor Type Lock Type Supported Features
adOpenDynamic adLockBatchOptimistic adAddNew, adBookmark, adDelete, adFind, adHoldRecords, adMovePrevious, adUpdate, adUpdateBatch
adLockOptimistic adAddNew, adBookmark, adDelete, adFind, adHoldRecords, adMovePrevious, adUpdate, adUpdateBatch
adLockReadOnly adBookmark, adFind, adHoldRecords, adMovePrevious
adOpenForwardOnly adLockBatchOptimistic adAddNew, adDelete, adFind, adHoldRecords, adUpdate, adUpdateBatch
adLockOptimistic adAddNew, adDelete, adFind, adHoldRecords, adUpdate, adUpdateBatch
adLockReadOnly adFind, adHoldRecords

Client-Side Cursor Combinations

To set a client-side cursor location, you can use this line of code:


 obRecordset.CursorLocation = adUseClient

The following tables list the combination supported by all three providers, assuming a client-side cursor location:

Cursor Type Lock Type Supported Features
adOpenStatic adLockReadOnly adApproxPosition, adBookmark, adFind, adHoldRecords, adMovePrevious, adNotify, adResync