Cascade delete

G

Guest

If i use the SQL command with out the on delete cascade it works but i need
it with the cascade delete on but then i get the error 'syntax error in
contraint clause'.
What do i wrong?

SQL command:
ALTER TABLE EigenarenGW ADD CONSTRAINT Exploitatie_FK Foreign Key (EX_CODE)
REFERENCES EXPLOITATIES (EX_CODE) ON DELETE CASCADE
 
M

Michel Walsh

Using ADO?


Assuming the constraint does NOT already exist, try (in the immediate debug
window, as example)



CurrentProject.Connection.Execute "ALTER TABLE EigenarenGW ADD CONSTRAINT
Exploitatie_FK Foreign Key (EX_CODE)
REFERENCES EXPLOITATIES (EX_CODE) ON DELETE CASCADE"

(one single line)




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top