Difference between revisions of "MS Access and MySQL/migrating"
m (migrating MS Access to MySQL moved to MS Access and MySQL/migrating: reorganizing) |
(copied data types from /connecting) |
||
Line 3: | Line 3: | ||
* creating compatible table schemas in MySQL | * creating compatible table schemas in MySQL | ||
* actually copying the data | * actually copying the data | ||
− | * accessing migrated data from Access/[[VBA]] or [[Visual Basic]] | + | * accessing migrated data from Access/[[VBA]] or [[Visual Basic]]: this is covered in [[../connecting]] |
− | + | ==Data Types== | |
− | == | + | [[ODBC]] appears to translate data types it doesn't understand into Memo fields. This would be fine, except that you can't sort on Memo fields – so you may have to use types which ODBC can handle better. Fields which can't be sorted on also can't be designated as indexes in the data schema (on MySQL's end), or Access will refuse to import the table. |
− | + | {| | |
− | + | |- | |
+ | ! MySQL type || MS Access type || Notes | ||
+ | |- | ||
+ | | TINYTEXT || Memo | ||
+ | |- | ||
+ | | VARCHAR(255) || Text || field size = 255 | ||
+ | |- | ||
+ | | INT || INT(4) | ||
+ | |} | ||
+ | (I'll add to this table as more examples come up.) | ||
+ | |||
+ | Access also has trouble dealing with AUTOINCREMENT fields (usually used for ID) in the table data viewer. If you create a new field but leave the autonumbered ID field blank, on exiting the field Access will show the record as "''#deleted''". If you close and reopen the table data view, the new data appears. If you enter an ID by hand when you create the record, this problem doesn't happen. |
Latest revision as of 01:37, 9 November 2008
Overview
This page is about moving data from MS Access to MySQL, which involves the following issues:
- creating compatible table schemas in MySQL
- actually copying the data
- accessing migrated data from Access/VBA or Visual Basic: this is covered in MS Access and MySQL/connecting
Data Types
ODBC appears to translate data types it doesn't understand into Memo fields. This would be fine, except that you can't sort on Memo fields – so you may have to use types which ODBC can handle better. Fields which can't be sorted on also can't be designated as indexes in the data schema (on MySQL's end), or Access will refuse to import the table.
MySQL type | MS Access type | Notes |
---|---|---|
TINYTEXT | Memo | |
VARCHAR(255) | Text | field size = 255 |
INT | INT(4) |
(I'll add to this table as more examples come up.)
Access also has trouble dealing with AUTOINCREMENT fields (usually used for ID) in the table data viewer. If you create a new field but leave the autonumbered ID field blank, on exiting the field Access will show the record as "#deleted". If you close and reopen the table data view, the new data appears. If you enter an ID by hand when you create the record, this problem doesn't happen.