Subject Re: [IBO] Cachedupdates with insert and edit of multiple rows
Author Svein Erling Tysvær
>i'm using Tib_Dataset with CachedUpdates and using Buffered View
>(Dataset buffer).
>The target is to disconnect the Dataset from database for inserting and
>editing rows.
>All is working fine with editing of multiple rows, but i've a problem to
>edit new inserted row.
>
>The steps are:
>
>1. load some rows in the buffer and show them. (TIB_Query.open,
>AutoFetchAll is true, CachedUpdates is true)
>2. insert new row ( Dataset.append, modify with Dataset.FieldByName )
>3. modify another row ( Dataset.edit, modify with Dataset.FieldByName)
>4. modify new row (from step 2) (Dataset.edit, modify with
>Dataset.FieldByName)
>5. transfer changes and the new row to database (Dataset.ApplyUpdates
>and Dataset.CommitUpdates).
>
>So, when i'm inserting a new row, it is not possible to modify that (to
>change to the edit mode is not possible), before inserted row will
>posted with Dataset.post or Dataset.ApplyChanges.
>If I'm using Dataset.post, it is possible to change to the edit state
>and to modify data, but changes (which were made in edit mode) are not
>be applied to database after ApplyUpdates and CommitUpdates are called.
>If DataSet.ApplyUpdates will called after new row was inserted, we have
>same behavior (changes are not be applied to database after ApplyUpdates
>and CommitUpdates are called).

Do you explicitly set the primary key at step 2?

Set