The information in this article applies to:
SYMPTOMSWhen using the Microsoft SQL Server OLE DB provider (SQLOLEDB) with OLE DB template consumer classes to open a rowset with a SQL query that contains GROUP BY and aggregate functions such as MAX, you might get a DB_E_ERRORSOCCURRED error from Open call. CAUSEYou have marked the rowset for change, insert, or delete when using the ATL Consumer Wizard or have added properties to make the rowset updateable. RESOLUTIONDo not mark the rowset for change, insert, or delete when the command contains an aggregate function. You can comment out the following lines in your ATL code:
STATUSThis behavior is by design. If a SELECT statement contains an aggregate function, such as MAX, a server-side cursor is automatically opened with a scroll option of CUR_INSENSITIVE and a concuropt of CUR_READONLY that is not updateable. For additional information, search for "dbcursoropen" in the SQL Server 7.0 Books Online. MORE INFORMATIONSteps to Reproduce the Behavior
Additional query words:
Keywords : kbDatabase kbDTL kbOLEDB kbSQLServ kbVC600 kbATL300 kbGrpVCDB |
Last Reviewed: November 24, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |