Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDynaset problem ring a bell?

10 views
Skip to first unread message

Joe Toomey

unread,
Mar 28, 1997, 3:00:00 AM3/28/97
to

This is a tough one. I'm using MSVC 1.52c with ODBC 2.1 and MS Access
2.0 data sources registered through the ODBC Manager and opened as
ODBC data sources.

I have been using a CDynaRecordset derived class which incorporates
the dynamic column binding mechanisms found in the DYNACOL Microsoft
sample code. In other words, I'm using modified versions of COLUMNST.H
and DYNASET.H to dynamically bind columns in a table. The modifications
I've made include deriving the CDynaSet class from CDynaRecordset rather
than CRecordset.

The application I'm developing (which has been is use for quite a while)
first adds a number of records to several tables in a CDatabase. This
is done simply with AddNew() and Update(). In all, 14 tables are opened
and about 130 records are added in total. When this is complete, all
of the CDynaSets are closed and deleted while the CDatabase is kept
open. After some other processing, I open a new CDynaset on one of the
tables (ordering the recordset by one of the columns and filtering
on the column as well) [SELECT * FROM tblFoo WHERE tblFoo.Mnemonic >=
'Foo' ORDER BY tblFoo.Mnemonic]. The recordset opens up correctly,
and I call Edit() and change the values of three of the fields. When I
call Update(), I get an Assertion failure, and then an Exception with
no error code or text description.

I have traced this problem into the DYNACORE.CPP file, and the problem
happens before the assertion failure. In the routine
ExecuteSetPosUpdate(), the call to SQLSetPos() returns
SQL_SUCCESS_WITH_INFO. This is not caught by the code, and when
SQLRowCount returns zero, it tries to throw an exception. This ends up
asserting because it can't find the String for
AFX_SQL_ERROR_NO_ROWS_AFFECTED in the String Resource. I'm not
sure why this happens, but I don't think it's the root of my problem.

I added some test code to ExecuteSetPosUpdate() which calls
SQLError() when SQLSetPos returns SQL_SUCCESS_WITH_INFO, and the
resulting error information is State:01S01, Message:
"[Microsoft][ODBC Microsoft Access 2.0 Driver] Error in row ",
Native Error: 89.

I have scoured the MSDN CD to find what Access 2.0's native error 89 is,
and I can't find the right reference.

Does anyone have any idea what might be happening here? I have used
ODBC SPY and checked Statement Handles, and I've traced as far into the
code as I can go.

Any thoughts or ideas would be greatly appreciated.
--Joe

0 new messages