Subject Re: No Active Transaction error
I've found that if I instead use

if (result == IDYES)

I have no problem, but I'm surprised I sometimes need an open
transaction to disconnect......could this be because of a particular
setting or relationship or event I've written? The problem occured
even on a simple query whenever a row was deleted.


--- In IBObjects@y..., s.beames@m... wrote:
> I have a call to a function:
> void __fastcall TMainForm::CloseUser()
> {
> if (DMod->tr1->TransactionIsActive)
> {
> int result = Application->MessageBox("Save your
> changes?", "Logging out...", MB_YESNO);
> if (result == IDYES)
> DMod->tr1->Commit();
> else
> DMod->tr1->Rollback();
> }
> DMod->cn1->Disconnect();
> }
> whenever the user logs out, or the main form closes. It's meant to
> prompt the user if he has forgotten to commit his changes.
> If I have been editing the master table on a form with master-
> queries and haven't finished the transaction, calling the above
> results in an exception "No active transaction to execute with"
> the Disconnect() call is made. The next attempt to quit is
> successful. The call stack below makes me wonder if the master-
> relationship is trying to update after disconnection(?).
> Any suggestions on how should I be doing this? I'm using 'Read
> Committed' isolation, BCB5, W98, IBO3.6De
-- call stack snipped --