Tricky transaction problem

Quote
<anders.malmb...@szg.externa.co.at> wrote:
>I believe that this must be a common problem:
>Two Datasets which both have been opened and put in append mode:

>Both Datasets are used in the same Form and should be storeed within
one transaction.
>This is what I've tried:

>procedure TFrmDetail.BtnOkClick(Sender: TObject);
>begin
>  DB.StartTransaction;
>  try
>     Qry1.Post;
>     Qry2.Post;
>     DB.Commit;
>     ModalResult := mrOk;
>   except
>        DB.Rollback;
>        if (Qry1.State <> dsInsert then
>            Qry1.Append;
>        if (Qry2.State <> dsInsert then
>            Qry2.Append;
>Then the values entered in the Form are cleared, which forces the user
>to reenter all values......
>Would appreciate if someone could give me some hints.

>Anders

<Answer from julia...@global.co.za (Julian van Tubbergh)

Quote
>If you do Qry1.Append then you are actually appending another record.
>What you should do is edit the current record.
>Change Append to Edit in the above code.
>This will allow you to re-execute Post without an exception and
>without clearing the data from the field components.

>Julian van Tubbergh.

Hello!
You kindly wrote an answer to my posetd transaction problem (which,  I'm
sorry to say, is now deleted).
I have tried it out, and it works. But with a drawback: The user must
reenter the data that were once entered.
If you have any idea how to solve that, I'd appreciate your ideas.

Regards,
Anders