Subject Re: CloseWithConfirm Problem
Author ehandbury
Found the problem...

I had a out-of-date and in-error InsertSQL string which Interbase was
complaining about. Seems strange, however, that the InsertSQL was
being prepared even though no work was being done.

--- In IBObjects@y..., "ehandbury" <ehandbury@h...> wrote:
> Hello,
>
> (IBO4.2Gc, BCB4, FB-1.0-796)
>
> I have a problem... Steps:
> 1) Show my main Client form which opens a # of TIB_Querys.
> 2) Press a button to close it without doing anything.
> 3) OnFormClose event fires where I have the following code:
> IB_Monitor1->Enabled = true;
> if (trClient->CloseWithConfirm() == 2)
> Action = caNone;
> IB_Monitor1->Enabled = false;
>
> I check trClient->InTRansaction before the CloseWithConfirm call
> and its false. When I step into the CloseWithConfirm call, my
> TIB_TransactionBar lights up and I get the following output in the
> OnMonitorOutputItem event:
>
> { "/*---\r\n
> PREPARE STATEMENT\r\n
> TR_HANDLE = 15997200\r\n
> STMT_HANDLE = 16005784\r\n
> \r\n
> INSERT INTO MBCLIENT VALUES(? /* CLIENTKEY */ ,? /* FILENUM
> */ ,'now','now',? /* NOTES */ );\r\n
> \r\n
> FIELDS = [ Version 1 SQLd 12 SQLn 30\r\n
> MBPRODUCTITEM.DESCRIPTION[PDESC] = <NIL>\r\n
> MBPROVIDERITEM.NAME[LNAME] = <NIL>\r\n
> MBPRODUCT.PRODUCTKEY = <NIL>\r\n
> MBPRODUCT.PRODUCTITEMKEY = <NIL>\r\n
> MBPRODUCT.REFNUM = <NIL>\r\n
> MBPRODUCT.STATUS = <NIL>\r\n
> MBPRODUCT.LOANAMOUNT = <NIL>\r\n
> MBPRODUCT.BALANCE = <NIL>\r\n
> MBPRODUCT.INTERESTONLY = <NIL>\r\n
> MBPRODUCTITEM.PROVIDERITEMKEY = <NIL>\r\n
> MBPRODUCT.SETTLEDDATE = <NIL>\r\n
> MBPRODUCT.CLOSEDDATE = <NIL> ]\r\n
> \r\n
> ERRCODE = 335544569\r\n
> ----*/" }
>
> ...And then my program blows up. What I can't understand is why
the
> Insert statement is being generated? I didn't do anything to the
> datasets and InTransaction was false before the CloseWithConfoirm
> call.
>
> Thanks for any help. Eric.