Data Access and Transactions

Previous Topic Next Topic

Static vs. Dynamic Cursors

When you request a static cursor, you are requesting a snapshot of the data at the time the Recordset is created. Once the client has received all the rows, the cursor can scroll through all data without any further interaction with the server. The cursor position can be changed using both relative positioning (offsets from the current, top or bottom row) and absolute positioning (using the row number). The static cursor’s only shortcoming is that changes made to the database while the Recordset is open aren’t made available to a client using a static cursor.

A dynamic cursor, on the other hand, makes database changes available as they happen. Because the dynamic cursor requires the database provider to reorder data in the Recordset as it changes on the server, it is much more expensive than the static cursor in terms of the processing it requires. Also, because the order of the underlying records could change, only relative positioning is available to dynamic cursors. Lastly, dynamic cursors don’t support bookmarks. If you need bookmark support, use a keyset or static cursor.


© 1997-1999 Microsoft Corporation. All rights reserved.