Subject Post/Cancel : (was [IBO] Rollbacks)
Author Malcolm Smith
My application has no code relating to this section of the application.
There is basically a TIB_Grid to browse/edit data in a spreadsheet style
(type of data requires this presentation).

I am only using the TIB_UpdateBar component. Basically if a user scrolls
beyond the last row I assume the grid is going into Insert mode

How can I tell if something has been entered and therefore ask the user if
they want to post the record. If no data has been entered then I can just
cancel the operation.

I just realised I used the wrong term again. Nothing has been posted hence
there is nothing to rollback.

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146

-----Original Message-----
From: Jason Wharton [mailto:jwharton@...]
Sent: Friday, 6 September 2002 12:13
Subject: Re: [IBO] Rollbacks

Not sure, we would have to know more about your application. I would think
you would either need to know to Post or Cancel before you were concerned
about doing a Commit or Rollback.

> If a user browses via a grid and presses the down arrow until the grid
> into insert mode automatically, enters no data and then closes the form I
> get an exception because of missing required fields.
> Apart from asking the user if they want to commit, is this code the
> way to handle it.
> if(transMaster->Started && !transMaster->InTransaction)
> {
> try
> {
> transMaster->Commit();
> }
> catch(...)
> {
> transMaster->Rollback();
> }
> }
> where transMaster is the transaction.
> I'm not doing any explicit transactions in my form.