PRB: Unable to Move to Previous Records in Recordset

Last reviewed: July 18, 1997
Article ID: Q112758
1.50 WINDOWS kbprg kbprb

The information in this article applies to:

   The Microsoft Foundation Classes (MFC), included with:
    - Microsoft Visual C++ for Windows, version 1.5

SYMPTOMS

When running an AppWizard-generated application that uses the database classes, you may note that the "move previous," "move first," and "move last" buttons on the toolbar for the record view are unavailable (dimmed or gray). This problem occurs even though you have moved past the first record, and should be able to select these toolbar buttons. The "Previous Record," "First Record," and "Last Record" choices under the Record menu are also unavailable after moving past the first record in a recordset.

If you are not using AppWizard-generated code, you may notice that a call to CRecordSet::MovePrev(), ...MoveFirst() or ...MoveLast() will result in a database exception.

CAUSE

The cause for this problem is a failure of the ODBC.DLL to load the ODBCCURS.DLL file. The ODBCCURS.DLL file is the cursor library. This dynamic-link library (DLL) gives scrollable cursor functionality to ODBC Level 1 drivers. Therefore, if this DLL isn't loaded, scrollable cursor support is unavailable. A forward-only cursor will be used.

There are two reasons why the cursor library (ODBCCURS.DLL) won't load:

  • An older version of ODBC.DLL (the ODBC driver manager) is used.
  • The ODBCCURS.DLL file can't be found. This DLL should be located in the WINDOWS\SYSTEM directory. If the ODBCCURS.DLL is missing, you'll see the following message in the Output window when running the application with the debugger:

          Cursor library not used.  Load failed
          State:IM006,Native:0,Origin:[Microsoft][ODBC DLL]
          State:S1C00,Native:0,Origin:[Microsoft][ODBC Single-Tier Driver]
          State:01000,Native:0,Origin:[Microsoft][ODBC DLL]
    

RESOLUTION

Check to see that the file <path>\WINDOWS\SYSTEM\ODBC.DLL is the same date or newer than <path>\MSVC\REDIST\ODBC.DLL on the Visual C++ CD. If not, copy the file from the CD to your <path>\WINDOWS\SYSTEM\DIRECTORY.

If the ODBCCURS.DLL isn't located in the <path>\WINDOWS\SYSTEM directory, copy it from the <path>\MSVC\REDIST on the Visual C++ CD.

NOTE: To be absolutely sure you have correct versions of the ODBC DLLs, you should run the Visual C++ Setup program again and select "Custom Installation." Then, select only the "MFC Database (ODBC)" check box so that you copy only the needed ODBC components. You will also want to select the ODBC drivers you need by clicking the Drivers button next to the "MFC Database (ODBC)" check box.


Additional reference words: 1.50 2.50 grayed move prev first exception
greyed grey App Wizard last
KBCategory: kbprg kbprb
KBSubcategory: MfcDatabase
Keywords : kb16bitonly MfcDatabase kbprb kbprg
Technology : kbMfc
Version : 1.50
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.