Have you thought of adding a "Record_Change_Log" table to your database instead of writing to a text file?
Of course the issue becomes, how do you write diverse data records to the Record_Change_Log table. Perhaps the easiest method would be to have the following:
Record_Change_Log Table:
LogEntryID AutoIncrement Unique Log Entry ID
LogEntryTimeStamp Date TimeStamp of Change
TableName Text Obviously the table
modified
Action_ID Numeric (Long) Foreign Key to
Record_Action table
Original_Record Memo
Altered_Record Memo
Modified_By (????) User ID Link for User
that made the change
Record_Action Table:
Action Text Human Consumable Action
name (e.g. Insert,
Delete, etc.)
Action_ID AutoIncrement Unique Record Action ID
The bad news is that it is going to take a bit more than "just . . . a couple of lines of code" because you are going to have to record all of the information in a retrievable format, e.g. XML, for the actual record data.
The good news is you are faced with the same problem if you use a text file because you are once again going to have to record the information in a retrievable format.
The really bad news is that what you are saying you want to do requires a somewhat radical re-thinking of the over all design of your database. To accomplish the task you seem to want to accomplish means that all of your data entry is going to have to be done using some sort of "entry transaction file" approach.. That means that you will have to have a parallel set of tables that allow you to enter, for example, new employee records, employee records to be deleted, or updates to employee records and then process those entries to perform the actual insertions, deletions, or updates by means of a lot more than "just . . . a couple of lines of code".