Solved

Editing database RecordSet with VC++4.0

Posted on 1998-10-27
9
173 Views
Last Modified: 2010-04-02
I'm writing simple database interface programs (SDI). I can read the data from the databases fine.
When I edit a numeric field, it is accepted, all is still fine. But when I try to edit a character field, I get
an precision error message box.It will accept nothing but the text that was originally there. WHy is
this, and what do I do to be able to edit the existing character field? I'm running on Win95, VC++4.0, using FoxPro2.6a. Thanks for any clues.
0
Comment
Question by:pigeonbr
  • 5
  • 4
9 Comments
 
LVL 4

Expert Comment

by:pagladasu
ID: 1176365
Do you have any member variables associated with the edit controls. Check the number of characters they are supposed to contain.
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1176366
Do you have any member variables associated with the edit controls. Check the number of characters they are supposed to contain.
0
 

Author Comment

by:pigeonbr
ID: 1176367
In the member variables tab of ClassWizard in the CRecordSet, my member variable is named say, m_Name for the name field in the FoxPro .dbf file, and in the CRecordView the corresponding Edit Box control is mapped to ->m_Name. This is true for the numeric field I call m_Drawer, for example, and for the several other fields which are all defined as character fields in the FoxPro database setup. Like I stated earlier, if I modify the data I have displayed in the edit box for the numeric (double) field, it takes it and when I click the Move to next Record arrow, it accepts the new data input, updates the database field, and moves on to the next record. However, I can't for the life of me figure out why I get an invalid precision message box when I do the same in the character or CString fields. I tried in the ClassWizard setting the max number oc chars to the same limit I had setup in the database, but it changes nothing. If for example the field contains the string " Kenwood", when I replace it with anything other it gives me the error. If I re-type Kenwood it accepts and passes on to next record. Somewhere, it's checking to see if the data entered is exactly like what was originally there, otherwise, it is not accepted. Where is this being checked, and why is the same thing not happening with the numeric field?
0
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!

 
LVL 4

Expert Comment

by:pagladasu
ID: 1176368
I have used Access and Oracle databases with VC++ applications. However, I am yet to face such a problem with text/character type of data fields. I have not used used Foxpro.
I cannot really figure out why you are getting this problem. Try using the same application with an Access database.

0
 

Author Comment

by:pigeonbr
ID: 1176369
Very well. I will attemp it. I have access on my pc, but the reason I am so hooked on FoxPro is because we use it at the office and I am working on database applications for it. I will see if Access solves these little problems however, and get back to you as soon as I can. Thanks!
0
 

Author Comment

by:pigeonbr
ID: 1176370
I tried,  as you suggested, using Access as my database, and the updating of text fields now functions properly. I would have liked to get it working, but maybe someday I'll look into it further. I will let you know if anything else comes up that I can't figure out using Access. Thank you and keep up the good work. Please consider my question as answered. I will change my working database and that's that I guess. :)
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1176371
Hey. Maybe the question remains answered here. However,  I will give a try with Foxpro and maybe give  you a feedback on email. My email address is:
espical@hotmail.com
0
 

Author Comment

by:pigeonbr
ID: 1176372
Very well. Don't waste too much of your time on it though. Please let me know if I have something special to do for you to receive your points, for I'm not real familial with the procedures here. Thanks!
Bruce

0
 
LVL 4

Accepted Solution

by:
pagladasu earned 100 total points
ID: 1176373
Go ahead!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

679 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