问题
i am having an Access database with many tables and thousands of records in it, if anybody changes any data in it , any row, or even only a cell, is there any way to get to know what specific row or cell has been changed in the Access database, any property or should I use any trigger ?
回答1:
I had a similar problem a couple of years back with an MSSQL DB and I seem to recall that both ACCESS (MDB) and SQL (MDF) Databases DON't inherantly support this. You, if I am not mistaken, will have to adopt the principles:
1) Transactional Data should NEVER be adited, only reference historical records with new records containing the changed values. I took it from three angles :
- I had a column called PrecursorRecId which held the record_id of the most recent record the update related to.
- Another column held and Context_ID under which all related records were linked by a common value which was the key Id column of AuditTxnContext table.
- Record's TxnDate (pretty logical)
2) Master Data records Also were not altered but each record had an EffectiveFromDate and and EffectiveToDate where the records with a NULL EffectiveToDate were considered current. Depending on the sensiitivity of the table, creation of MaterData records was accompanied by Audit Entry records. Again, there is a RecordCreatedDateTime which does not automatically match the EffectiveFromDate stamp.
This may help you going forward but there's not much to assist with your existing data. I also don't have much idea of what it is you are working on so my input is fairly generic. I hope it helps any way. I would welcome anyone's input if I am in error, this is just how we approached our challenge.
Tell me a bit more if you are still dealing with it. If not, maybe close your question.
Cheers
Mac
来源:https://stackoverflow.com/questions/10193096/how-to-get-the-record-details-which-has-been-changed-in-access-database