Subject Re: [IBO] Can't update on TIB_Grid
Author Helen Borrie
At 03:01 PM 26-12-00 +0100, you wrote:
>I have a table with Primary Key filled (assigned) by the server on a
>(BEFORE INSERT, ID=unique value ...)
>Then, when I make new records on a Grid, all rules ok, and the records
>appears as new rows (without ID).

>But if I try to modify a row, I get "cannot locate record" error, because
>they haven't ID.

At this point the rows exist only in the client buffer. The error occurs
because you cannot "update" rows that you have simply begun to insert.

Set the transaction's PostRetaining to true; and post the inserts before
you attempt to update.

>After refresh, or close&open, the ID has value, and update is now possible.
>Is there any way to avoid this?

This question really asks, "Is there any way to update rows before they
exist in the database?" Of course the answer is "No". I wonder why you
need to update rows that have just been inserted, anyway.


>Some help will be appreciated.

All for Open and Open for All
InterBase Developer Initiative ยท