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.
Showing posts with label Access. Show all posts
Showing posts with label Access. Show all posts
Tuesday, 12 April 2011
Monday, 11 April 2011
To Convert Microsoft Access Table Into MySQL Table
Currently using: Microsoft Access 2007, phpMyAdmin.
1. In Access, export into csv file.
a) export the table into text format, however in the file name, make sure the file extension is csv.
b) do not specify any export options.
c) choose 'delimited' format, my preference: delimiter - Semicolon, text qualifier - " -- to match with the options in phpMyAdmin later.
d) finish it.
2. In phpMyAdmin, import the csv file.
a) make sure that the database and tables are using collation of "utf8_unicode_ci", benefit: it will avoid the conversion of special characters when importing the csv file.
b) create a table where the field structure types are to be the same as in the Access table.
c) in the table, select 'import' and choose the csv file.
d) 'character set of the file' is 'utf8', 'Format of imported file' is 'CSV'.
d) finish it.
3. There it goes!
1. In Access, export into csv file.
a) export the table into text format, however in the file name, make sure the file extension is csv.
b) do not specify any export options.
c) choose 'delimited' format, my preference: delimiter - Semicolon, text qualifier - " -- to match with the options in phpMyAdmin later.
d) finish it.
2. In phpMyAdmin, import the csv file.
a) make sure that the database and tables are using collation of "utf8_unicode_ci", benefit: it will avoid the conversion of special characters when importing the csv file.
b) create a table where the field structure types are to be the same as in the Access table.
c) in the table, select 'import' and choose the csv file.
d) 'character set of the file' is 'utf8', 'Format of imported file' is 'CSV'.
d) finish it.
3. There it goes!
Subscribe to:
Posts (Atom)