The information in this article applies to:
SYMPTOMSMicrosoft SQL Server versions 6.0 and 6.5 support dynasets. To use an updatable dynaset, you must have a unique index on one or more fields in the table. If there is no such index, the recordset will be read only. Also, CRecordset::CanAppend() and CRecordset::CanUpdate() will return FALSE. STATUSThis behavior is by design. MORE INFORMATION
If you create a dynaset without specifying a unique index on one or more
fields in the table and then try to update or add a record, MFC will
throw an exception that says the cursor is read-only. Additionally, you
will see the following errors in the MFC Trace output:
In Visual C++ version 2.x and 4.x: In Visual C++ 5.0, you will see: Note that if you use the PRIMARY KEY specification new to SQL Server version 6.0 when creating your tables, you will automatically generate a unique index on the primary key. Here is an example of this syntax:
If you are using the Microsoft SQL Server ODBC driver, version 2.65.0201,
that comes with SQL Server version 6.5, MFC will throw an exception that
says:
Additionally, you will see the following errors in the MFC Trace output:
Additional query words: CanUpdate CanAppend kbvc151 kbvc152 kbvc200 kbvc210 kbvc220 kbvc400 kbvc500 kbvc600
Keywords : kbusage kbDatabase kbMFC kbODBC kbVC |
Last Reviewed: September 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |