Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2002 (Scaling of Decimal )

Status
Not open for further replies.

legend91

MIS
Joined
Apr 25, 2003
Messages
3
Location
US
I have converted a Access database from 97 to 2002. I received no errors after the conversion and the Visual basic code compiled without any errors. The database works fine up until the point when it runs the part of the vb code which calls upon a function. I receive a error stating that " Runtime error (3579) Scaling of decimal value resulted in data truncation". Does anyone have any suggestions.
 
Legend91,
Scaling refers to the number of digits that are allowed to be stored to the right of the decimal point.

You may or may not have noticed it, but sometimes when you store data in a database (not just Access), and it is a float or say, double data type, a number like 63.24 might actually be stored as 63.2399999999.

This is usually not a big deal, but once in a while, like when you say "If field x = 63.24 then bla bla", it will jump up and bite you.

One way we get around the problem (there are several ways), is that we have a little sub that we patch into a database which prompts for a table name, field name, and scale then goes through the table, multiplying every number by 10, raised to the power of the scale, then takes the int() of the answer, multiplyies it by 10, raised to the negative power of the scale, and plugs it back into the table.

It's ugly, but effective.

Your problem is probably coming from the fact that your numbers in the '97 database were stored as singles or doubles, and some of them have the "99999999" stuff on the ends.

Remember that what you see displayed when you open a datasheet in Access is not necessarily *exactly* what is stored in the underlying table.

Tranman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top