RDO Cursor Library

   

Remote Data Objects (RDO) supports several different cursor libraries. While not all RDO cursor libraries support all types of cursors, every library at least supports forward-only cursors. For example, the ODBC cursor library can only support static and forward-only cursor types, while the SQL Server cursor library supports static, forward-only, keyset-driven, and dynamic cursors.

The RDO cursor library choices are listed in the following table.

Cursor library Constant
Uses the ODBC cursor library. This gives better performance for small result sets, but degrades quickly for large result sets. rdUseODBC
Uses server-side cursors if they're available (such as with SQL Server). rdUseServer
Uses the client batch cursor library. This library creates all cursors on the client-side. With this option you can create dissociate result sets, perform offline changes to the data, and re-associate the result set with a live connection to post updates back to the database using optimistic batch updates. This option is very efficient because only one round trip to the server is needed. rdUseClientBatch
The ODBC driver chooses the appropriate style of cursor and uses server-side cursors if available. Because this is the default, if you connect to Microsoft SQL Server, RDO chooses server-side cursors. If you connect to Oracle or other ODBC data sources, the ODBC cursor library is used. rdUseIfNeeded
RDO creates a forward-only, read-only, cursorless result set. rdUseNone

You can control how the data source and the chosen RDO cursor library manage concurrency with the locking options in the following table.

Locking type Constant
Pessimistic concurrency. rdConcurLock
Optimistic concurrency using row versions. rdConcurRowVer
Optimistic concurrency using row values. rdConcurValues
Read-only. Changes are not permitted. rdConcurReadOnly
All updates are deferred until the batch update is finished. rdConcurBatch

If you submit a query that contains more than one SELECT statement to SQL Server using the server-side cursor library, the ODBC driver will reject the query because it is unable to handle this situation. If you must execute multiple result set queries or stored procedures that contain multiple SELECT statements, you have several alternatives. You can:

  • Convert the query to submit individual SELECT statements.
  • Use the cursorless result set option (rdUseNone).
  • Create a forward-only, read-only result set with the RowsetSize property of the parent rdoQuery object set to 1.
  • Switch to the ODBC cursor library (rdUseODBC).

For More Information   For more information on the RDO cursor library, search online for "Choosing an RDO Cursor Library" in MSDN Library Visual Studio 6.0. For more information on using locks to handle multiuser concurrency situations, see Managing Concurrency with Cursor Locks in this chapter.