Difference between revisions of "MS Access and MySQL/connecting"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (→‎Notes: index bad)
m (→‎Notes: index bad for non-sortable field types, that is)
Line 4: Line 4:
  
 
==Notes==
 
==Notes==
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.
+
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.
 
{|
 
{|
 
|-
 
|-
Line 14: Line 14:
 
|}
 
|}
 
(I'll add to this table as more examples come up.)
 
(I'll add to this table as more examples come up.)
 
Also, Access didn't seem to like it when I had a field designated as an index; it refused to import the table until the index was removed.
 

Revision as of 01:45, 14 November 2005

It is possible to use Microsoft Access as a client – or as an intermediary for Visual Basic code – while using MySQL as the database engine. This provides a somewhat less bumpy migration path for VB/VBA applications.

The basic technique is to set up your MySQL server as a data source via ODBC. (I'll post more about that later, but it's fairly intuitive. Under Windows 98, ODBC data sources are created and configured with the "ODBC Data Sources (32 bit)" in the Windows Control Panel; the process should be similar for later versions of Windows. Once you've created a source, you link to its tables with Access.)

Notes

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

(I'll add to this table as more examples come up.)