From: Michael D. P. <ra...@dr...> - 2005-10-09 21:22:08
|
I am using mdb-schema to export an Access 2000 database. All is working well expect the field sizes of the text fields are all twice as large as they should be in the mdb-schema output. For example, I have two text fields, one length 5 and the other 255 as reported by Access. However, the schema output (mysql backend) is: DROP TABLE Table1; CREATE TABLE Table1 ( TextField5 varchar (10), TextField255 varchar (510) ); The content of the test file is (mdb-export): TextField5,TextField255 "abcde","LotsOfData" Is this a bug? A character set issue? Is there a work-around already designed into mdbtools? The problem is that MySQL doesn't like the varchar fields being larger than 255 (it wants a BLOB instead) when importing the schema file. Also, it allocates twice the size than necessary. When viewing the .mdb file with a hex editor all the field contents are contiguous: 1afe0 00 00 02 00 ff fe 61 62 63 64 65 ff fe 4c 6f 74 ......abcde..Lot 1aff0 73 4f 66 44 61 74 61 15 00 09 00 02 00 02 00 03 sOfData......... Therefore, there doesn't seem to be a reason why the size should come up double what Access says it is, unless I'm misunderstanding something here (entirely possible...). I have recreated this problem using a very simple Access database generated from scratch (above). I have also tried using mdbtools compiled on Cygwin(Win2k) and Linux, both from the CVS sources, with the same results. The field sizes are also independent of the backend selected in mdb-schema. Thanks for the help, Michael |