BUG: Error 16929, "Cursor Is Read Only" for Cursor w/OpenQuery()

ID: Q197392


The information in this article applies to:

BUG #: 35132 (SQLBUG_70)

SYMPTOMS

Updating a remote table using the UPDATE WHERE CURRENT OF statement on a cursor opened with the OpenQuery() syntax fails with the following error message:

Msg 16929, Level 16, State 1
The cursor is READ ONLY.

The cursor may also fail at declaration time if the FOR UPDATE clause is used.


CAUSE

A static cursor is being generated with the OpenQuery() syntax.


WORKAROUND

To work around this problem, do either of the following:


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.


MORE INFORMATION

Dynamic, Forward-Only and Fast Forward-Only cursors are not supported over distributed queries. If you request any of the above types of cursors, the cursor will attempt to open a keyset cursor by default. If a keyset cursor is not supported for the query, a static cursor will be generated. This is expected behavior.

However, if a keyset cursor is opened using the OpenQuery() syntax, it will incorrectly be downgraded to a static cursor. The end result is, no matter what type of cursor is requested with the OpenQuery() syntax, a static cursor is generated. Because static cursors are Read Only, any attempt to update the cursor will receive the error message noted in the SYMPTOMS section of this article.

For more information on cursors, see the "Declare Cursor (T-SQL) topic in the SQL Server 7.0 Books Online.

Additional query words: insensitive err oledb


Keywords          : SSrvTran_SQL kbbug7.00 
Version           : WINNT:7.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: April 20, 1999