简体   繁体   English

如何获取Access数据库中已更改的记录详细信息

[英]How to get the record details which has been changed in Access database

我有一个包含许多表和数千条记录的Access数据库,如果有人更改其中的任何数据,任何行,甚至只有一个单元格,是否有任何方法可以了解哪些特定的行或单元格已被更改Access数据库,任何属性还是应该使用任何触发器?

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. 几年前我用MSSQL DB遇到了类似的问题,我似乎记得ACCESS(MDB)和SQL(MDF)数据库并不是非常支持这一点。 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. 1)不应该引用交易数据,只引用包含更改值的新记录的历史记录。 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. 我有一个名为PrecursorRecId的列,它保存了与更新相关的最新记录的record_id。
  • 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. 另一个列和Context_ID,其中所有相关记录都通过一个公共值链接,该公共值是AuditTxnContext表的关键Id列。
  • Record's TxnDate (pretty logical) 记录的TxnDate(非常合乎逻辑)

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. 2)主数据记录也没有改变,但每个记录都有一个EffectiveFromDate和EffectiveToDate,其中具有NULL EffectiveToDate的记录被认为是当前的。 Depending on the sensiitivity of the table, creation of MaterData records was accompanied by Audit Entry records. 根据表的灵敏度,MaterData记录的创建伴随着审计条目记录。 Again, there is a RecordCreatedDateTime which does not automatically match the EffectiveFromDate stamp. 同样,有一个RecordCreatedDateTime,它不会自动匹配EffectiveFromDate标记。

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 苹果电脑

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM