[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

Editing database RecordSet with VC++4.0

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
pigeonbr
Asked:
pigeonbr
  • 5
  • 4
1 Solution
 
pagladasuCommented:
Do you have any member variables associated with the edit controls. Check the number of characters they are supposed to contain.
0
 
pagladasuCommented:
Do you have any member variables associated with the edit controls. Check the number of characters they are supposed to contain.
0
 
pigeonbrAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
pagladasuCommented:
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
 
pigeonbrAuthor Commented:
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
 
pigeonbrAuthor Commented:
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
 
pagladasuCommented:
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
 
pigeonbrAuthor Commented:
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
 
pagladasuCommented:
Go ahead!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now