Action logging

Maurice

New Member
Hello there,

In our application, we want to keep track of:
who added/updated/deleted which record at what time.
Therefore I want to create a tabel called "ActLog" with these fields:
- cTableName
- reRecid
- daDate
- iTime
- cUser
Storing recid will give problems when dumping and reloading, because the recid stored does not have to be the same after loading.

I'm looking for a solution for storing the primary key fields & values in this table.
How can I do that?

Is there another solution for my problem? What?

Does anybody have any experience which could be helpful for me?


Thanx in advance ,

Maurice
 
Not really a solution just another idea:

A few of the databases have the following 4 fields in every table:
Creator_User, Creator_Date, Changer_User, Changer_Date.

Every save is then recorded in the record in the table directly. The problem is of course that you dont know what has been changed.
 

Maurice

New Member
What about:
- logging delete actions?
- performance when asking information about all the actions of one user?
 

jamesmc

Member
Hi there Maurice,

Take a look at the code in the zip file that I have attached. There are three programs but the one you should be interested in is called getinfo.p. You will need to change the table name to something that you can use but basically what it will allow you to do is specify a recid of a record along with the table name and the name of the index that you want to use and the program will return the value of the first four fields within the supplied index.

All of the returned values have been converted to character so the formatting will be lost (leading zeros will be removed etc).

If there isn't four fields within the index it will return however many there are.

you will need to put all of the programs somewhere in your propath or change the run statements to specify the fully qualifed path. I have only tested this code in GUI.

The code may be a little messy and I am sure there is a better way to achieve this but its the best I could do in the time that I had spare.

If you have any problems with this please e-mail me at the address below.

HTH,

James.
 

Attachments

  • getval.zip
    1.7 KB · Views: 11
Top