A
ant1983
Hi,
I have a database where different users would be able to change the value of
certain fields.
I would like to capture the name of that user, the date and time of the
change and what was changed in a table so that i can report on this. (For
auditing purposes)
I have no idea how to go about this. I would imagine that i would have to
create the following tables:
tblUser
- autUserID
- txtUserName
- txtUserPassword
tblChanges
- autChangeID
- txtUserName (Linked with above table)
- dateChangeDate
- txtTableNameChanged (this would probably be the table that where the
change happened)
- txtFieldNameChanged (this would prob be the field in the table above that
changed)
- txtRecordIDChanged (thsi would probably be the PRIMARY KEY of the record
in the table that was changed)
My questions are:
1 - Am i on the right track in terms of the structure as above?
2 - If so, how would i capture the old vs the new data - e.g. if in table
"tblBooking" the value of the field "dateBookingDate" was changed from "1
March 2008" to "8 March 2008" - how would i capture this in my "tblChanges"?
Would i have to add two extra fields; "txtOldValue" and "txtNewValue"?
3 - Lastly, how would my database know which user made the change? I
imagine that if the user start's their FE they would have to be prompted for
their UserName and Password and the database would have to remember this
throughout the session? - How would i implement this?
Many thanks for this. I know ask a lot of questions and that it is quite
in-dept but i knwo this post will help a lot of users.
Thanks,
Wayne
I have a database where different users would be able to change the value of
certain fields.
I would like to capture the name of that user, the date and time of the
change and what was changed in a table so that i can report on this. (For
auditing purposes)
I have no idea how to go about this. I would imagine that i would have to
create the following tables:
tblUser
- autUserID
- txtUserName
- txtUserPassword
tblChanges
- autChangeID
- txtUserName (Linked with above table)
- dateChangeDate
- txtTableNameChanged (this would probably be the table that where the
change happened)
- txtFieldNameChanged (this would prob be the field in the table above that
changed)
- txtRecordIDChanged (thsi would probably be the PRIMARY KEY of the record
in the table that was changed)
My questions are:
1 - Am i on the right track in terms of the structure as above?
2 - If so, how would i capture the old vs the new data - e.g. if in table
"tblBooking" the value of the field "dateBookingDate" was changed from "1
March 2008" to "8 March 2008" - how would i capture this in my "tblChanges"?
Would i have to add two extra fields; "txtOldValue" and "txtNewValue"?
3 - Lastly, how would my database know which user made the change? I
imagine that if the user start's their FE they would have to be prompted for
their UserName and Password and the database would have to remember this
throughout the session? - How would i implement this?
Many thanks for this. I know ask a lot of questions and that it is quite
in-dept but i knwo this post will help a lot of users.
Thanks,
Wayne