Subject Re: [IBO] Dataset state lost just before posting
Author Helen Borrie
At 01:00 AM 19/03/2003 +0000, you wrote:
>Hi there,
>
>I am getting a 'Dataset not in edit or insert mode' message
>(EDatabaseError) when trying to post changes to a TIBOQuery, even
>where I am sure the state of my TIBOQuery is dsInsert. The TIBOQuery
>is called quDetallecot in the following code snippet:
>
>if fmCotiza.quDetallecot.State in [dsEdit,dsInsert] then
> begin
> showmessage('Dataset *is* in dsEdit,dsInsert');
> fmCotiza.quDetallecot.Post;
> Close;
> end;
>
>The Showmessage does fire indicating that state is OK, but I get the
>error message at the Post line. State is lost somewhere between the
>Showmessage and the actual post (!). The TIBOQuery does have only one
>event (OnNewRecord) where one TField is initialized, there's nothing
>else in the events list.
>
>Any hints?

Benton,
You have not supplied any details of work done between the call to Edit and
the call to Post...

However, if nothing was modified in the current row, then Post is not a
valid call. IOW, a dataset state of dsEdit does not imply that Post can
be called.

If you need to test something, try testing InternalDataset.NeedToPost.

Helen


Helen