views:

35

answers:

1

Hi,

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:

  1. Create a Recordset from a query
  2. Make various change to the recordset
  3. 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)

Thanks in advance

+1  A: 

I personally have never used this functionality, but the documentation states you can set rs.Filter property to adFilterPendingRecords to 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 .Status property has the adRecModified flag set, then you can compare .Value and .UnderlyingValue of each of the fields to see whether they are different.

GSerg
GSerg - I had hunted high and low for information regarding this, and is the final piece of the puzzle as far as I'm concerned!What a star.
Dave