ON DELETE CASCADE

R

RachelT

Morning Experts,

I'm using wondering how i can switch on Cascade delete within a database im
creating programmatically. I have it all working created all the tables
e.t.c. However I want to know how to implement Cascade delete throught SQL
using the RunSql statement. Is it possible? Can i use "ON DELETE CASCADE" If
so how is that implemented I keep getting errors, I did a search on the net
and on here both nothing really seems to help my problem.

Any help much appreciated

Rachel
 
D

David Lloyd

Rachel:

One way to programmatically create a Relation is to use the CreateRelation
method of the DAO database object. You can then append the Relation to the
Relations collection of the Database object.

Using SQL, you would use the "ON DELETE CASCADE" syntax of the CONSTRAINT
Clause of either the ALTER TABLE or CREATE TABLE SQL statement.

In the VB Editor in Access 2003, if you use the Help task pane and browse
the Table of Contents you will see a "Microsoft Jet SQL Reference" section.
Look under the "Data Definition Language" subsection and the help topic for
the "CONSTRAINT Clause."

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Morning Experts,

I'm using wondering how i can switch on Cascade delete within a database im
creating programmatically. I have it all working created all the tables
e.t.c. However I want to know how to implement Cascade delete throught SQL
using the RunSql statement. Is it possible? Can i use "ON DELETE CASCADE"
If
so how is that implemented I keep getting errors, I did a search on the net
and on here both nothing really seems to help my problem.

Any help much appreciated

Rachel
 
Top