Subject Re: [IBO] TIBOQuery record was not located to update
Author Helen Borrie
At 12:53 PM 23-04-01 +0000, you wrote:
>Hi,
>I am using a third party component set as agenda.
>The component set is PimFlash.
>Since PimFlash only recognises standard dbase components I am forced
>to use the TIBOQuery component.
>This seems to work, but if I add several (3-4) appointments in a row,
>I got the error 'Record was not located to update'.

I believe that something is trying to update a record that has not yet been committed to the database. You will need to take explicit control of the transaction and make sure you commit it before allowing any new records to be edited, i.e., to clarify...

{implicitly start transaction, default for IBOQuery}
MyDataset.Insert; {row now exists in buffer but not in database...new PK is created, e.g. by GeneratorLinks and dataset cursor is positioned on the new row}
MyDataset.Edit; {put dataset in edit state and edit current row in buffer}
[[user adds some values]]
MyDataset.Post; {tries to send SQL "Update aTable set aField='ValueEntered' where PK=newPK" but of course the row can't be found because it is inside the same transaction, which is not yet committed}

Cheers,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________