mike said:
i'm looking for a way to create the equivalent of a SQL trigger in MS
Access 2003. is there such a thing.
No, the Jet data engine does not support triggers or similar. However,
the majority of triggers I write in SQL Server 2005 are to enforce
constraints that Jet 4.0 is capable of without triggers.
That's right! I said constraints in Jet 4.0 are better than SQL Server
2005. Primarily:
1) CASCADES in DRI (foreign keys) is better implemented in Jet i.e. you
are far less likely to see the 'may cause cycles or multiple cascade
paths' failure. When the engine is capable of keeping the data in synch
between tables there is less need for a triggers to do the same.
2) CHECKs constraints that reference multiple tables, including the
current table and current row, are supported in Jet 4.0. In SQL Server
(and most other data engines) subqueries in CHECK constraints are not
supported. This is very a very powerful feature of Jet.
Notably missing from Jet is the INSTEAD OF family of triggers that e.g.
allow controlled changes to VIEWs (stored Queries), making otherwise
unupdateable VIEWs updateable. However, I would not trade such
functionality for a fix of Jet's most glaring limitation: you can only
perform one SQL command per SQL procedure. Put another way, if Jet did
have triggers they would be very limited.
What are you trying to achieve? It could be that you could change your
schema design to avoid the need for triggers.
Jamie.
--