Subject Re: [IBO] Cursors losing buffer after insert
Author paulfilmer
--- In IBObjects@y..., Helen Borrie <helebor@t...> wrote:
> Paul,
> I'm not quite clear what you mean by "look at the data again".

Thanks Helen.

Sorry. I'll try and say this again...



For INSERTING a record:

C_Cursor.ParamByName('pPRIMARY_FIELD').AsInteger := 0;
C_Cursor.Open;
C_Cursor.Edit;
C_Cursor.FieldByName('PRIMARY_FIELD').AsInteger := 123;
... + other fields assigned here.
C_Cursor.Post;

And after the post we find that:
C_Cursor.FieldByName('PRIMARY_FIELD').AsInteger = 0

Because the data has been committed to the server and the local
buffer emptied. This I can understand.



However, EDITING a record:

C_Cursor.ParamByName('pPRIMARY_FIELD').AsInteger := 123;
C_Cursor.Open;
C_Cursor.Edit;
C_Cursor.FieldByName('PRIMARY_FIELD').AsInteger := 124;
C_Cursor.Post;

And we see that the updated data is still available to us:
C_Cursor.FieldByName('PRIMARY_FIELD').AsInteger = 124


So my confusion is: why does the buffer do things differently for an
edit operation. And if we CAN keep the buffer after an edit, is it
possible to do the same after an insertion.

Hope this makes a little more sense!

Paul.