Solved

Editing database RecordSet with VC++4.0

Posted on 1998-10-27
9
170 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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

706 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

18 Experts available now in Live!

Get 1:1 Help Now