Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create a trigger to Ms Access database
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00355403
Message ID:
00355525
Vues:
23
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform