开发者

Visual Basic 6 ADO Update issue

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 change开发者_JAVA技巧d...

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.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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜