Re: Recovering from an updatebatch error with a clone - Thanks Brian!


2005-11-06 07:18:20 AM
delphi261
Brian Bushay TeamB <XXXX@XXXXX.COM>writes:
Quote
>Well no I don't lose the data... It is there, only that the edits
>cannot be saved.
>I looked at the BetterAdodataset.LoadFromFile and it does:
>
>Close;
>CommandType := cmdFile;
>LockType := ltBatchOptimistic;
>CommandText := FileName;
>Open;
>
>And Open if it is already open won't do anything... Only idea that I
>have left is to create another dataset in memory and copy the data
>there as backup
>but it is really overkill.

Yes if CommandType is cmdFile then yes open uses the file.
You have to set command type back to cmdText and command text back to
your original query as well as set you connection to get back to your
original state.
Cool IT WORKS!!! Thanks Brian!
--
Have you seen Marillion's Marbles? Visit www.marillion.com and get in
touch with the most amazing music...