[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1249
  • Last Modified:

Linked Foxpro table error : Decimal field precision too small

Hi Experts,

I'm using an Access 2000 database with Access 2003 SP1.  I linked some Foxpro tables via ODBC.  Most tables work just fine, but there's one that gives me the error "The decimal field's precision is too small to accept the numeric you attempted to add."

This error occurs on just a few records.  I'm able to open the table and see my data except for those few records, they show as "#Error"

I need these tables to be linked and can't change their design as they are used be another application wich can't be updated...

Any ideas ?


  • 2
1 Solution
Assuming that you are entering data into a form which is bound to the linked table.

On the appropriate controls set an event to format the value to the acceptable precision.

This could be a matter of checking the foxpro field for it's datatype and then looking up the acceptable values for that datatype then using either format or one of the Type Conversion Functions (check access help for them). For example

s = Format(13.9999999, "0.0000")

s is now a string with value 14.0000

I'm guessing a string ought to implicitly convert to a number. If not you can use the apprpriate type conversion and then put that into the field.
jmantha709Author Commented:
This solution doesn't work because the error arrives before the format function

s = Format(MyField, "0.0")

As soon as I try to retrieve the value of MyField I get the error, so I can't use it in any way.
Wait so you are getting the problem with the data coming in to the database?

Check out the design properties of your linked table. You need to kow what datatype the column giving you grief is. Then find the datatype in foxpro. Find an agreeable one in access and change to that.

Otherwise I guess you are looking at using passthrough queries maybe? I don't know if you can even do that with fox pro, I assume not. Can you not import the data and use a local table or do something which gives you control over that columns values?

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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