Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Audit Trail using a grid to modify data
Message
From
19/06/2003 23:14:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/06/2003 22:13:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00801858
Message ID:
00802043
Views:
28
>I could learn about these triggers, but I was hoping to find a quicker easier way to do it. Do you know of an easier way to do this with grids?

Triggers are not really difficult, and their big advantage is that they work no matter where you do the changes.

My article (the one about the audit-trail) includes a complete - albeit simple - audit function, and instructions on how to use it. You might use this as a starting-point.

The basic idea about triggers is really simple: every time a record is added / modified / deleted, a corresponding function is called. The fact that this is defined at the table level gives you a tremendous control which you didn't have in the FoxPro 2.x days.

I would strongly suggest you forget about an incomplete solution, like one that works only for a grid on specific forms. For instance, you could easily overlook a REPLACE, GATHER, INSERT INTO, etc. command somewhere in your code.

Apart from those considerations, Before/ and After/RowColChange seem to be the appropriate events to check for changes in a grid.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform