Re: NUMERIC / DECIMAL fields

Chris Craig <[email protected]> Fri, 8 Apr 2011 20:32:11 +0000 (UTC)
Newsgroups gmane.comp.db.mdb-tools.devel
Message-ID <[email protected]>
Jakob Egger <jabakobob <at> gmail.com> writes:
> Dear friends,
> 
> I finally found out how NUMERIC fields are really stored, so let me share this
> with you.

This is great work Jakob, I was wondering why the numeric fields weren't being 
loaded correctly with mdb-tools, I guess they were not fully supported.

Unfortunately your patch doesn't seem to fix the issue with the MDB files I'm 
receiving - In fact I loaded your sample file into Access 2007, made some minor 
modifications to the schema (changed scale from 5 to 6, for example), and after 
saving, the data was no longer read correctly.

Here are a few sample files that load correctly in Access 2007 - 
"Database200x.mdb" have bits taken from the actual files I've been processing, 
"decimals2000.mdb" is the reformatted version of your sample file. Interestingly 
Access decided it needed to be 80% larger or so...

decimals2000.mdb:
https://docs.google.com/leaf?
id=0B41UJ3cF5h0CMGM5YmQ3YWItMDk0Ni00MTE4LTk1NGItNjFlNzZlMjUyNzc5&hl=en

Database2003.mdb
https://docs.google.com/leaf?
id=0B41UJ3cF5h0COTM2MTU1MzItYTI5Mi00YjUzLWFlMzMtZTIyMDkxNjBkN2Q3&hl=en

Database2000.mdb
https://docs.google.com/leaf?
id=0B41UJ3cF5h0CMjI2MDM5ZTAtODk1ZS00ODkwLWE1OWEtNDkwYzM3NmFiYTY5&hl=en

For the last two files the data should be:
ON,0.0055,0.000715,0.433333
ON,0.0025,0.000325,0.133333

Using mdb-export (compiled on debian 64-bit or freebsd 7 on i386) it comes out 
as:
ON,0000000000.5500,0000000000.0715,0000000000.3333
ON,0000000000.2500,0000000000.0325,0000000000.3333

Actually now I just took a closer look at your sample file, and it doesn't seem 
to be handled properly either... I've double checked the source and it's 
definitely the patched version of data.c (mdb_num_to_string has been replaced by 
mdb_numeric_to_string, etc).

I'll take a look at the files and code myself and see what I can glean...

Thanks!


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev