Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: MFC ODBC Dynaset Cannot Update a SQL Server 6.0 View


View products that this article applies to.

This article was previously published under Q151686

↑ Back to the top


Symptoms

An MFC database application cannot update a dynaset-type CRecordset based on a View in a SQL Server 6.00 data source, even if the operation observes the SQL Server requirement that updates through Views only update a single base table. The update will give the following error:
Error: failure updating record.
The cursor does not include the table being modified
State:37000,Native:16933,Origin:[Microsoft][ODBC SQL Server Driver] [SQL Server]

↑ Back to the top


Cause

This error is caused by a bug in SQL Server 6.0 server cursors.

↑ Back to the top


Resolution

One workaround is to use snapshots with the cursor library to update the View. You can use a dynaset with a View as long as you are not updating it. If you must use a dynaset and need to update, try using a permanent or temporary table instead of a View, or open a separate recordset as a snapshot.

↑ Back to the top


Status

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug is corrected in Microsoft SQL Server version 6.50.

↑ Back to the top


More information

This problem only occurs when using a dynaset update. The recordset is opened correctly. The dynaset is scrollable forward and backward and MoveNext() and MovePrev() also work correctly but dynaset does not allow updates.

↑ Back to the top


Keywords: kbbug, kbdatabase, kbfix, kbprogramming, KB151686

↑ Back to the top

Article Info
Article ID : 151686
Revision : 4
Created on : 11/21/2006
Published on : 11/21/2006
Exists online : False
Views : 380