?
Solved

Updating the CRecordset variable components

Posted on 2002-03-26
4
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:GGRUNDY
ID: 6898150
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 400 total points
ID: 6898159
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
ID: 6907489
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
ID: 6907707
>>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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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