PRB: Unable to Move to Previous Records in Recordset

ID: Q112758


The information in this article applies to:


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:


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 query words: 1.50 2.50 grayed move prev first exception greyed grey App Wizard last


Keywords          : kb16bitonly kbDatabase kbMFC kbODBC kbVC 
Version           : 1.50
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: August 5, 1999