Re: Reapplying successfull batch updates

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 02/04/05


Date: Fri, 04 Feb 2005 09:02:51 -0600


>Hi Dell, nice to hear from you <g>
>But actually no it isn't quite that, and certainly doesn't behave that way.
>It has independant bookmarks and cursor positions etc. but same data. The
>ADO API ref says amongst other things "Changes you make to one Recordset
>object are visible in all of its clones regardless of cursor type.", and
>those changes include the record status. So if updatebatch is successful on
>the original dataset then the clone does not have any pending updates
>either.
I should have tested this before I posted it. The behavior you site above is
not quite what I observer. A cloned TadoDataset keeps its own set of updated
values after a batchUpdate and RecordStatus reflects that there are still
records to be update. However the oldValue of fields reverts to the current
value after a batchupdate to the source Dataset.
I had thought you could just clone the cloned Dataset back to the source dataset
but this fails to work because the Oldvalue no longer reflects the original
values.

What does work is Adodataset.SavetoFile before batchupdate
 and LoadFromFile if you need to revert to the old data.
Starting with Mdac 2.5 ADO has a SavetoStream and LoadfromStream method that
should work too (I haven't tested it) if you use it on the
TadoDataset.Recordset. TBetterAdoDataset http://betterado.hit.bg/ had direct
support for this feature

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com