C
CurryMan
I'm trying to add foreign key constraints to a table and everything
works
except that if I include the CASCADE ON DELETE/UPDATE options I get
errors.
Has any one got any ideas what I need to do or what could be wrong.
Cheers
Glenn
DoCmd.RunSQL "CREATE TABLE COLTBL (COLID COUNTER CONSTRAINT PrimaryKey
PRIMARY KEY, .... )", False
DoCmd.RunSQL "CREATE TABLE MAINTAB (....., COLID long ,.....)",False
DoCmd.RunSQL "ALTER TABLE MAINTAB ADD CONSTRAINT Constr1 FOREIGN KEY
(COLID) REFERENCES COLTBL"
***This works fine without ON UPDATE/DELETE Clause
DoCmd.RunSQL "ALTER TABLE MAINTAB ADD CONSTRAINT Constr1 FOREIGN KEY
(COLID) REFERENCES COLTBL ON UPDATE CASCADE ON DELETE CASCADE"
***But this comes up with and "Error in CONSTRAINT"
works
except that if I include the CASCADE ON DELETE/UPDATE options I get
errors.
Has any one got any ideas what I need to do or what could be wrong.
Cheers
Glenn
DoCmd.RunSQL "CREATE TABLE COLTBL (COLID COUNTER CONSTRAINT PrimaryKey
PRIMARY KEY, .... )", False
DoCmd.RunSQL "CREATE TABLE MAINTAB (....., COLID long ,.....)",False
DoCmd.RunSQL "ALTER TABLE MAINTAB ADD CONSTRAINT Constr1 FOREIGN KEY
(COLID) REFERENCES COLTBL"
***This works fine without ON UPDATE/DELETE Clause
DoCmd.RunSQL "ALTER TABLE MAINTAB ADD CONSTRAINT Constr1 FOREIGN KEY
(COLID) REFERENCES COLTBL ON UPDATE CASCADE ON DELETE CASCADE"
***But this comes up with and "Error in CONSTRAINT"