Microsoft KB Archive/118875

= FIX: ClassWizard "Bind", "Update Columns" Buttons Disabled =

Article ID: 118875

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 6.1

 Microsoft Visual C++ 1.0 Professional Edition

 Microsoft Visual C++ 2.0 Professional Edition

 Microsoft Visual C++ 4.0 Standard Edition</li></ul>

 Microsoft Visual C++ 4.1 Subscription</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q118875

<div class="symptoms_section">

SYMPTOMS
In ClassWizard, choose the Add Class command button. From the Add Class dialog box, select the Import Class command button. In the Import Class dialog box, type the name of a CRecordset-derived class that you would like to import, specifying the header and implementation files from which to import. ClassWizard then imports the class so that you can see object IDs and members, but so that you are not able to bind variables ("Bind All") or update column information ("Update Columns") from the "Member Variables" tab; this is because ClassWizard is not aware that the CRecordset-derived class is associated with a database.

<div class="cause_section">

CAUSE
ClassWizard does not copy the database information from the .CLW file associated with the imported class. That file contains a "DB" section that tells ClassWizard to look for data source information. If the DB section is missing, ClassWizard does not enable the Bind All and Update Columns command buttons.

<div class="resolution_section">

RESOLUTION
To work around this problem, copy the DB section from the .CLW file that is associated with the imported CRecordset-derived class to the .CLW file of the current project. For the Enroll sample, the section should look like this: <pre class="fixed_text">  [DB:CSectionSet] DB=1 ColumnCount=6 Column1=CourseID,1,8,1 Column2=SectionNo,1,4,1 Column3=InstructorID,1,8,1 Column4=RoomNo,1,10,1 Column5=Schedule,1,24,1 Column6=Capacity,5,2,1 The DB section for the imported CRecordset-derived class contains the "DB=1" line as shown and column count and name lines reflecting the correct values for that class.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the products listed at the beginning of this article. This problem no longer occurs in Microsoft Visual C++, version 5.0 or later because the Import Class command no longer exists (you can no longer import a class from an existing source file).

Additional query words: crecordset import add

Keywords: kbbug kbdatabase kbfix KB118875

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.