By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,656 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,656 IT Pros & Developers. It's quick & easy.

on delete cascade problem

P: n/a
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a
connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch
to the sql view, and perform it, it complains about a syntax error at
the word "delete".

does anyone know why that is?

thanks
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
hilz wrote:
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a
connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch
to the sql view, and perform it, it complains about a syntax error at
the word "delete".

does anyone know why that is?

thanks


no takers?
Nov 13 '05 #2

P: n/a
hilz wrote:
hilz wrote:
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a
connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch
to the sql view, and perform it, it complains about a syntax error at
the word "delete".

does anyone know why that is?

thanks

no takers?


I assume the back-end database is something like SQL Server?

Access SQL is slightly different to T-SQL, if you made your query a
"pass through" one it would probably work apart from the fact you
already created the constraint so it would probably complain about that :-)
Nov 13 '05 #3

P: n/a

"hilz" <no*@y.com> wrote in message
news:eUA8f.4995$UM1.1460@dukeread10...
hilz wrote:
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch to the sql view, and perform it, it complains about a syntax error at the word "delete".

does anyone know why that is?

thanks


no takers?


hilz,

You may not execute CASCADE clauses via MS Access Query Objects.

I *believe* you must use DAO and execute the SQL directly.
Sincerely,

Chris O.
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.