ALTER TABLE syntax

G

GPO

Hi all. I'm trying to add cascading deletes via Data Definition Query in
Access 2000 and have run into a spot of bother. I'm getting a "syntax error
in constraint clause" message for the following:

ALTER TABLE tblA ADD CONSTRAINT fk_A_B FOREIGN KEY (field_B_fk) REFERENCES
tblB (field_PK) ON DELETE CASCADE

It is highlighting the word 'DELETE'.

Does Access support the addition of cascade deletes via Data Definition SQL?

Regards

GPO
 
M

MGFoster

Your db has to be SQL 92 compliant. I don't know if Access 2000 has
this option, but, in Tools > Options; on the Tables/Queries tab - check
the "SQL Server Compatible Syntax (ANSI 92)" check box "This database."
 
G

GPO

Thanks MG,

I have since seen a post (from Allen Browne, I think) which indicates that
the SQL UI in Access uses DAO and that DAO does not support this. I have had
success in making it work with ADO though.
 

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