FIX: Cursor Library Returns Duplicate Row in Asynchronous Mode (124897)
The information in this article applies to:
- Microsoft Open Database Connectivity 2.0
This article was previously published under Q124897 SYMPTOMS
When the ODBC Cursor Library is used to set up a static cursor with a
driver whose asynchronous mode is enabled, it returns duplicate rows
under certain circumstances. These duplicate rows are returned every time
an asynchronous operation with the driver returns SQL_STILL_EXECUTING. The
number of duplicate rows retrieved on subsequent fetches (MoveNext's in
MFC) is variable. Certain conditions can cause as many as 500 consecutive
repetitions of the same record.
This behavior has typically been observed in MFC applications using the
ODBC database classes to build snapshots (which cause the ODBC Cursor
Library's static cursor implementation to be used).
WORKAROUND
Users of MFC database classes can avert this behavior by:
- Setting synchronous mode on by calling the SetSynchronousMode() method
of CDatabase
- Using forwardOnly recordsets
Users of the ODBC API and the Cursor Library can work around the behavior
by:
- Calling SQLSetStmtOption (hstmt, SQL_ASYNC_ENABLE,
SQL_ASYNC_ENABLE_OFF).
- Using forward-only cursors in the Cursor Library.
STATUS
Microsoft has confirmed this to be a problem in ODBC Cursor Library version
2.00.1510. This problem has been fixed in the 32-bit version of the ODBC
2.5 Cursor Library (ODBCCR32.DLL, 2.50.3006). The 16-bit cursor library has
not been changed. If you are using the 16 bit SQL Server driver, this
should not be a problem because you can use the server side cursors in SQL
Server version 6.0 and eliminate the need for the cursor library. If you
are using the Access driver, you need to use the 32-bit driver and the new
32-bit cursor library.
Modification Type: | Major | Last Reviewed: | 6/12/2001 |
---|
Keywords: | kbbug KB124897 |
---|
|