Solved

Updating the CRecordset variable components

Posted on 2002-03-26
4
179 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
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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 105
maxBlock challenge 30 142
method notes when mouse over in eclipse 5 87
matchUp  challenge 9 115
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

808 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