Subject | Re: [IBO] "Statement has not been prepared" |
---|---|
Author | Helen Borrie |
Post date | 2002-09-23T13:16:46Z |
At 12:42 PM 23-09-02 +0000, you wrote:
Only call Unprepare when you are totally finished with the prepared
statement.
When you do, test it first, viz.
(apols for pascally syntax)
if qry->Prepared
{
qry->UnPrepare
}
Same with a transaction - you'll get an error if you call Commit on a
transaction that has not been physically started, so always test a
transaction for InTransaction or TransactionIsActive before calling Commit
or Rollback.
Helen
>Thanks for that HelenWell, you can't Unprepare a statement that hasn't been prepared, can you?
>
>I added 'if qry->NeedToPost' and it stopped the 'Cannot Post Row'
>messages :-) however, I still get the "Statement has not been
>prepared" message.
>
>When I execute:
>
>if qry->NeedToPost
> > {
> > qry->Post();
> > qry->IB_Transaction->Commit();
> > }
> > qry->Close();
> > qry->Unprepare();
>
> in FormCloseQuery, everything is hunky-dory. It seems as though
>the exception is coming when the Transaction or (TIBO_)Query is
>deleted.
Only call Unprepare when you are totally finished with the prepared
statement.
When you do, test it first, viz.
(apols for pascally syntax)
if qry->Prepared
{
qry->UnPrepare
}
Same with a transaction - you'll get an error if you call Commit on a
transaction that has not been physically started, so always test a
transaction for InTransaction or TransactionIsActive before calling Commit
or Rollback.
Helen