FIX: SQLOLEDB: IRowset::SetData() Returns DB_E_ERRORSOCCURRED with Identity Column (235332)
The information in this article applies to:
- Microsoft OLE DB Provider for SQL Server 7.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Data Access Components 2.1 SP2
This article was previously published under Q235332 SYMPTOMS
When using the SQL Server OLE DB provider and OLE DB consumer Templates with a SQL Server database, calling CRowset::SetData() on the CCommand object to update a record returns DB_ERRORSOCCURRED when the table contains an identity column and the status for the identity column is set to DBSTATUS_S_IGNORE prior to calling SetData(). The description information for the error is "Errors Occurred" no additional error information is available.
CAUSE
This is a bug in SQL Server OLE DB provider version 07.00.623
RESOLUTION
SQLOLEDB provider version 07.01.069x included with SQL 7.0 SP1 fixes the problem.
Alternatively, create multiple accessors and perform GetData() calls using an accessor with the identity column to read the record and update using another accessor which doesn't include the identity column.
STATUS
Microsoft has confirmed this to be a problem in SQL Server OLEDB provider version 7.00.623. This problem has been corrected in SQLOLEDB provider version 07.01.069x included with U.S. Service Pack 1 for Microsoft SQL Server
version 7.0.
For information about downloading and installing the latest SQL
Server Service Pack, see http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b.
REFERENCES
Please see the following topics in MSDN online documentation:
- VC++ documentation for COLUMN_ENTRY_STATUS
- OLE DB Topic titled "Status" defines "DBSTATUS_S_IGNORE"
For additional information about using an identity column with MSDASQL provider, please see the following KB article:
Article ID: Q194678
Title: "HOWTO: SQL Server Identity, OLE DB Templates and OLE DB for ODBC"
Modification Type: | Major | Last Reviewed: | 5/5/2006 |
---|
Keywords: | kbbug kbDatabase kbDTL kbfix kbMDACNoSweep kbProvider KB235332 |
---|
|