A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Trigger on table insertion



 
 
Thread Tools Display Modes
  #1  
Old June 16th, 2008, 12:59 AM posted to microsoft.public.access,microsoft.public.access.tablesdbdesign
John
external usenet poster
 
Posts: 308
Default Trigger on table insertion

Hi

Is it possible to add a trigger on record insert on a table so I can check
for certain conditions when a record had been inserted into a table?

Thanks

Regards


  #2  
Old June 16th, 2008, 07:34 AM posted to microsoft.public.access,microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Trigger on table insertion

No. if your data is stored in Access tables, JET has never provided
table-level triggers.

If the data is attached from a different db such as SQL Server, you may be
able to add the triggers there.

Alternatively, if the data is entered through a form, you can use the form's
AfterInsert event procedure to simulate the trigger.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" wrote in message
...

Is it possible to add a trigger on record insert on a table so I can check
for certain conditions when a record had been inserted into a table?


  #3  
Old June 17th, 2008, 12:17 AM posted to microsoft.public.access,microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Trigger on table insertion

Triggers were the way that DBA's enforced referential
integrity in relational DBMS's. When Access/Jet was
designed 15-20 years ago, Access/Jet instead got a
new and better way: Declarative Referential Integrity.

When the rest of the world caught up with Access/Jet,
by retro-fitting DRI to their DBMS's and modernising their
SQL, triggers were left behind as the way to handle rare
complex calculations that could not be handled by declaration
in the DBMS.

So, two points: (1) Access/Jet is no longer the market leader
in DBMS design. You get more and better if you use
Access/SQL Server. (2) DB design used to be full of triggers.
It is not any more. Look to see if your 'certain conditions'
can be better handled by field restrictions or DRI.

10 years ago I would have said that the best way to handle
remaining cases was with VB code and DAO transactions,
but since DAO transactions against SQL Server were broken
8 years ago and never fixed, that leads you to a dead end
with no realistic upgrade path to SQL Server. If upgrade to
SQL Server is a future possibility, and you can't fix your
problem now with better design, better to do your transactions
now in SQL Server, rather than waiting till later.

(david)

"John" wrote in message
...
Hi

Is it possible to add a trigger on record insert on a table so I can check
for certain conditions when a record had been inserted into a table?

Thanks

Regards




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.