I try to make a script for generating backend databases. When I try to
make a relationship between a table named 'users' and another table
name 'layouts' an error occurs.
Option 1:
CurrentDB.Execute "ALTER TABLE layouts ADD CONSTRAINT users_layouts
FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE"
Option 2:
DoCmd.RunSQL "ALTER TABLE layouts ADD CONSTRAINT users_layouts FOREIGN
KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE"
All environments are set to ANSI 92.
I prefer to use Option 1 which fails, Option 2 doesn't. Could anybody
give an explanation for this?