Tuesday, 12 April 2011

To Convert Microsoft Access Table Into MySQL Table - Part 2

There are some common practices to be done when doing this type of conversion:

1. Before converting Access file into CSV file, make sure
a) Data does not contain any backslash (\) and semicolon (;) -- programming common sense.
b) Be careful of the usage of any special characters, because utf8_bin will not recognize it.
c) In Access, when changing column of "Currency", it's better to change into "Text" but not "Number" because the decimal of the data will be removed when changing into "Number" whereas the decimal of data will still be kept if it is changed into "Text".

2. If using phpMyAdmin and MySQL, make sure
a) The format of date/datetime/timestamp and the number/currency/float/decimal in the Access file is compatible with the field formats in the MySQL table -- otherwise you will get something like 0000-00-00 00:00:00 for your datetime, or $123.00 in your price/amount field.
b) My suggestion is to set the date/time into text/varchar format for the conversion, and later change them into date/time format in MySQL using php, and so with the number/currency field.

3. Try to play with it, and you will know what i am talking about.

No comments: