Subject Re: [IBO] "Statement has not been prepared"
Author Tickerboo Support
> Hmmm. Somehow I think this is the first time you mentioned you were using
> custom DML. It might be revealing to see what the custom DML is for the
> offending operation...

It is, sorry, I didn't think it made any difference since I wasn't
inserting, updating or deleting anything.

> > Started: true
>
> means the transaction has been started but nothing (even a prepare) has
> happened inside it yet. When a Prepare happens, InTransaction becomes
true.

Ooh! That's odd. In my FormShow event I have:

ShowTransactionState(tn);
qry->Prepare();
ShowTransactionState(tn);
qry->ParamByName("USER_ID")->AsInteger = dmMain->GetUserID();
qry->Open();

When I run this, InTransaction is still false even after preparing the qry.
Which is odd.


> Or a timing issue: likely that, by the time FormCloseQuery fires, IBO has
> already done the housekeeping on any lingering statements.

I hope not, all my IBO post/commit code is in FormCloseQuery events!

> I'm confused as to why you are calling Locate() at all during an Edit. A
> dataset's Insert, Update and Delete methods always operate on the current
> record in the buffer - the one the cursor is on. Are you saying that you
> let the user scroll around the dataset whilst editing an unbound control
> pertaining to a particular record? If so, I guess you have some reason
for
> this...I'd always want to keep unbound edits securely pinned to the record
> they belong to.

I'm using a third-party non-data aware component.

If the user doesn't change anything and closes the form, there's no error.
If I do a locate and the user still doesn't change the data, then there's an
error when the form closes. There's something about 'Locate' Does it place
the row into an Edit state?

> OTOH, if it's a ground floor window, the fresh air might help...

Thanks for your help, I greatly appreciate it.

David
PS I'm doing something daft I just know