Microsoft KB Archive/112758

{|
 * width="100%"|

PRB: Unable to Move to Previous Records in Recordset

 * }

Q112758

-

The information in this article applies to:


 * The Microsoft Foundation Classes (MFC), included with:
 * Microsoft Visual C++, 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 \WINDOWS\SYSTEM\ODBC.DLL is the same date or newer than \MSVC\REDIST\ODBC.DLL on the Visual C++ CD. If not, copy the file from the CD to your \WINDOWS\SYSTEM\DIRECTORY.

If the ODBCCURS.DLL isn't located in the \WINDOWS\SYSTEM directory, copy it from the \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 kbprb

Issue type : kbprb

Technology : kbAudDeveloper kbMFC