Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a trigger to Ms Access database
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00355403
Message ID:
00355525
Views:
22
>How can i do that, i´m creating references with sql code.
>
>I need to create references with "enforce referential integrity", "cascade update related fields" and "cascade delete related rows" programaticaly.
>
>I'm using Delphi 4, how can i do it.
>
>I'm using this.
>
>ALTER TABLE Table1 ADD CONSTRAINT ConstraintName
>FOREIGN KEY (key1) REFERENCES Table2
>
>It creates the relationship between table1 and table2, but it's missing something to create cascade update and cascade delete.

You can't do it programatically but you can configure Access to cascade the updates and deletes.

From the menu, choose Tools - Relationships. Select a relation, right click on it and select Edit Relation. You can choose what items you want done. When records are deleted or updated in the Access database, the Jet engine will take care of this for you. It is not a trigger but it will do this limited job for you.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform