Subject Re: [IBO] state
Author Helen Borrie
At 06:30 PM 13/08/2003 +0000, you wrote:
>Not working - got exception, that can't edit current record. Although
>TIB_Datasource has autoedit & autoinsert set to true,

Do you have an editable dataset? Show us your SQL statement. (You may need
custom xxxxSQL properties).

Do you have KeyLinks set?

>but I need to
>set edit/insert state manually
>Now in TIB_Edit is displayed first entry and I can't edit it until set
>insert/edit state manually :-/

If the dataset is editable, call Edit or Insert to place it into dssEdit or
dssInsert, respectively:

if (not (MyQuery.State in [dssEdit, dssInsert])) then
MyQuery.Edit; // or MyQuery.Insert
else
// do something about the pending work on this record

>Commit isn't TIB_Query member, so how to call manual commit (if
>autocommit is set to false)?

if MyQuery.NeedToPost then
if MyQuery.ib_transaction.TransactionIsActive then
try
MyQuery.Post;
MyQuery.ib_transaction.Commit;
except
// call appropriate exception handler
end;

(apologies for Delphi code)

Helen