Subject Re: [IBO] Data Aware components - question
Author Helen Borrie
At 05:26 PM 18/10/2004 +1000, you wrote:

>Hi,
>
>I am currently having some problems with TIB_Edit components.
>
>(1)
>If I set the DataSource component property AutoEdit = true and the
>AustoInsert property to false. (The reason, is so that I can edit the
>TIB_Edit component) and I set the TIB_Cursor property RequestLive = true.
>
>--- Problem ---
>
>If the application user edits the content of a TIB_Edit, but then decides to
>not hit the Commit Button on the form, the changes are not committed to the
>DB. Perfect just as expected. However, if the application user was to make a
>search for the same record she/he just edited, but did not commit, the
>TIB_Cursor will display the record with the modifications, and not the
>record as it is in the DB.
>
>Why??????

Those properties (AutoEdit and AutoInsert) are properties of the interface,
not of the dataset. AutoEdit says that you want the datasource to put the
dataset into Edit mode when the user types something; AutoInsert says that
you want to put the dataset into Insert mode when the user scrolls past the
end of the buffer.


>Regardless of the TIB_Edi properties I set, the application user is not able
>to edit the content of the TIB_Edit. I have tried setting every possible
>combination of the TIB_Edit properties including:
>
> dbedtLoginName->Enabled = true;
> dbedtLoginName->ReadOnly = false;
> dbedtLoginName->PreventEditing = false;
> dbedtLoginName->PreventInserting = false;
>
>
>What am I doing wrong???

To make a dataset "editable" you must do two things:

1) set RequestLive true (or, alternatively, provide custom XXXSQL
properties that make a non-updatable dataset updatable)

and

2) set correct KeyLinks

You might have set KeyLinksAutoDefine to true in expectation that the
dataset would find its own KeyLinks automatically. In the case of a simple
query of one table, that includes the columns of the primary key, this is
what happens. But if your SQL doesn't include the key in the set, or if
the query has a join, Autodefine doesn't work and you must set KeyLinks
yourself. They also must be correct, i.e. uniquely identify one record in
the buffer.

Helen