FIX: Invalid Cursor State Error with the MS Oracle ODBC Driver (183295)
The information in this article applies to:
- Microsoft ODBC for Oracle version 2.0 Build 2.73.7269
- Microsoft ODBC for Oracle version 2.0 Build 2.73.7283.01
- Microsoft ODBC for Oracle version 2.0 Build 2.73.7283.03
- Microsoft ODBC for Oracle version 2.0 Build 2.73.7356
This article was previously published under Q183295 SYMPTOMS
The Microsoft Foundation Classes (MFC) ODBC database classes supplied with
Visual C++ have a CRecordset::Requery() method that refreshes the records
in an open recordset. The CRecordset::Requery() method calls the ODBC API
function SQLExecute() followed by SQLExtendedFetch(). If a record in a
Dynaset type recordset is updated before calling CRecordset::Requery(), the
following error message is generated:
[Microsoft][ODBC driver for Oracle]Invalid cursor state.
RESOLUTION
Here are two ways to prevent this error when using the MFC ODBC classes:
- Call CRecordset::Close() followed by CRecordset::Open() instead of
CRecordset::Requery() to refresh the recordset.
-or-
- Use the ODBC Cursor Library and a Snapshot type recordset. Call
CRecordset::Requery() as usual.
NOTE: If using the ODBC API directly, call SQLPrepare() before calling
SQLExecute() and SQLExtenedFetch() to refresh the recordset.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This issue has been corrected in the
Microsoft Oracle ODBC Driver version 2.573.2927 or higher. This driver can be found in Visual Studio 6.0, Data Access Software Development Kit (SDK) 2.0 or higher, and in the Microsoft Data Access Components (MDAC) version 2.0 or higher. You can download the latest version of MDAC 2.0 from the following Web address:
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbbug kbDriver kberrmsg kbfix kbMDAC250fix kbMDACNoSweep kbOracle KB183295 |
---|
|