Linked Foxpro table error : Decimal field precision too small

Posted on 2004-11-09
Last Modified: 2012-06-21
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 ?


Question by:jmantha709
    LVL 8

    Expert Comment

    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.
    LVL 15

    Author Comment

    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.
    LVL 8

    Accepted Solution

    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?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

    760 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

    12 Experts available now in Live!

    Get 1:1 Help Now