Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Editing database RecordSet with VC++4.0

Posted on 1998-10-27
9
Medium Priority
?
176 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
[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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 400 total points
ID: 1176373
Go ahead!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

715 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