Access not importing relationships for MySQL linked tables -


i have linked mysql database access database file. working fine except relationships in mysql database not appearing in access.

i have made plenty of relationships in mysql tables using foreign keys, these relationships not reflected in access. kindly me import relationships mysql database access.

software i'm using: mysql version 5, microsoft office 2013, access file format: .accdb

while true mysql foreign key constraints don't show default in relationships tab in access, constraints still in place in mysql , still enforced linked tables.

for example, have 2 mysql tables, [customers] , [orders], foreign-key constraint on [orders]. if link tables in access , try insert row [orders] linked table [customerid] not match [customerid] in [customers] linked table insert fails:

insertfailed.png

odbc --insert on linked table 'orders' failed.

[mysql][odbc 5.2(w) driver][mysqld-5.5.29-0ubuntu0.12.04.2]cannot add or update child row: foreign key constraint fails (`zzztest`,`orders`, constraint `orders_ibfk_1` foreign key (`customerid`) references `customers` (`customerid`)) (#1452)

you can go relationships tab in access , create "access-side" relationships mysql tables...

editrelationships.png

...but notice "enforce referential integrity" options greyed out because function of database setup @ server, not in access. really, benefits "access-side" relationships offer are:

  • "documentation" of relationships (which database diagram generated against mysql database), and

  • "automatic" joins between linked tables in access query designer (which can happen without [access] relationships if tables have columns same name).

it's decide whether worth trouble create "access-side" relationships.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -