ADO and OLE DB map cursors over the result sets of executed SQL statements. SQLOLEDB implements these operations using server cursors, which are cursors implemented on the server and managed by API cursor functions.
To use a server cursor, an application can set these properties to anything other than the default value:
The CursorLocation property should remain at the default setting, adUseServer.
Server cursors are created only for statements that begin with:
Even if an application explicitly requests a server cursor, server cursors are not created for statements such as INSERT.
Server cursors cannot be used with statements that generate more than one recordset.
This restriction applies to all statements described in Generating Multiple Recordsets. For more information, see Generating Multiple Recordsets. If a server cursor is used with any statement that generates multiple recordsets, an application can return one of the following errors:
This example shows the opening of a dynamic server cursor:
Dim rs As New ADODB.Recordset
. . .
rs.Open "SELECT * FROM titles", , adOpenDynamic, adLockOptimistic
rs.Close