in******@online.sinor.ru (Alex Boborikin) wrote in message news:<c3**************************@posting.google. com>...
I create a table in MS access:
CREATE TABLE TABLE1
(_ID COUNTER PRIMARY KEY,
SESSION_ID INTEGER REFERENCES SESSIONS (SESSION_ID),
FIELD1 INTEGER,
FIELD2 INTEGER,
);
session_id is linked to same named filed in tabble SESSIONS. this
query works ok, but I need cascade deletion of related records. what I
need add to this query?
You have to do this in DAO
Set rel = db.CreateRelation("NameOfRelation", "SESSIONS",
"TABLE1", dbRelationDeleteCascade)
rel.Fields.Append rel.CreateField("SESSION_ID")
rel.Fields("CASENBR").ForeignName = "SESSION_ID"
db.Relations.Append rel