Logging old & new values

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
devweb
Posts: 16
Joined: Sat 02 Feb 2008 08:10

Logging old & new values

Post by devweb » Mon 24 Aug 2009 08:04

Hello,

We would like to add logging capability to our application, but logging the old values & new values for each Insert/Update/Delete.

Is there any way to do that, or we should to it Manuel for each table?

I have tried to use SqlMonitor component, but it does not bring the old values.


Thanks for all.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Mon 24 Aug 2009 11:55

You should use MySQL Trigger.
See MySQL help.

devweb
Posts: 16
Joined: Sat 02 Feb 2008 08:10

Post by devweb » Mon 24 Aug 2009 13:21

Thanks for your suggestion, however I have these problems:

1. I use username/passwords on the application level, not the database, so how can I get the logged user who did the modifications?.

2. I need other info like Client IP, MAC add who made the modification.

3. Working on mySql triggers will require the work for each table, beside I want general way to work with other databases too.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 26 Aug 2009 06:13

MyDAC does not provide such functionality.
To solve this problem you can use triggers or create your own handler for each table on client side.

Post Reply