Solved

Updating the CRecordset variable components

Posted on 2002-03-26
4
174 Views
Last Modified: 2013-11-20
I have to update my  recordset classes
While updateing some recordsets return a message:
"Selected data source does not contain all the columns you recordset class needs"
If I simply continue , when I compile and run the program ,  I get an error message " too few params-expecting  n" (which means what???)
The approach I am using is to delete the offending recordset class along with  the clw file and add the recordset class again getting the necessary columns.
I'm just wondering if there is an easier way (ie mass delete the entire variable list and rebuild it).
There are over 50 columns in some recordset's so just comparing and deleting is a daunting task!
Txs


0
Comment
Question by:dooley090698
  • 2
4 Comments
 
LVL 3

Expert Comment

by:GGRUNDY
Comment Utility
Have a look in the "Member Variables" tab of the MFC Class Wizzard. When you have selected one of your recordsets in the "Class Name" field, does the "Update Columns" or "Bind All" buttons do what you want?
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
Comment Utility
After I make some modifications to a database table, I usually just use the classwizard to manually delete all previous bindings (select each one and delete it).  Then I use the [Bind all] button to set up the variables.  This is good if you use the ClassWizard's default naming convention (m_EXACTFIELDNAME) so that is the best naming convention to use.

Is there a faster way?  Yes.  Edit your CRecordset-derived source .H and .CPP files and delete all of the lines of code in the ClassWizard-maintained blocks.  But even with a large recordset, the click-and delete is pretty fast.

-- Dan
0
 

Author Comment

by:dooley090698
Comment Utility
Dan,
I followed your delete each variable in the CW and worked just fine.
Txs
BTW - how'd you get so smart :)
*me bows..humbled by the Great God of Knowledge * :)
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
>>BTW - how'd you get so smart :)
I eat peanuts.  Lots of them.  It's brain food.
 
But in this case, it is just experience.  This is one of the first problems people experience when using the ClassWizard with CRecordset classes.  The error message is way confusing.  One of the first things I tried was to simply start over by manually deleting.  If you have ever written Wizard-style (step-by-step, U/I-related) programs, you know that it is nearly impossible to take all things into consideration and that is often possible to "help the Wizard" by starting with a clean slate (in a known state).

-- Dan
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now