I’ve been working with a Legacy application which interacts with a database through ADODB, and most of the changes to records follow a fairly straightforward pattern of:
- Create a Recordset from a query
- Make various change to the recordset
- call .Update on the recordset.
What I’m wondering is, with ADODB recordsets, is there anyway to extract the ‘changes’. The logic which changes the recordset is scattered about, and all I need is the changes, not how it was changed…
Any suggestions for tracking changes in a recordset (in code, a trigger on the DB or similar is no use here)
I personally have never used this functionality, but the documentation states you can set
rs.Filterproperty toadFilterPendingRecordsto show records that have been changed but not sent to the server yet (only applies to batch update mode).Or, you could iterate through all records in a recordset, and if the
.Statusproperty has theadRecModifiedflag set, then you can compare.Valueand.UnderlyingValueof each of the fields to see whether they are different.