Subject Re: [IBO] POST vs UPDATE in TIBOQuery dataset
Author Helen Borrie
At 09:15 AM 26-09-01 -0700, you wrote:
>Hello:
>
>Hoping someone can help me to understand something (I'm still very new
>to IBO, IB and Delphi):
>
>Using IBO: TIBOQuery component with Woll2Woll components, but because
>there was no Tww checkbox, I used a LED and its ONCLICK event to change
>and show the state of a Boolean field. I'm using this in conjunction
>with their dbTreeView and everything works fine, except when I want to
>update the field, initially I tried to edit, getfieldbyname, post which
>did not update the underlying datasource, and caused the display to
>point to a record about 50 records beyond where I was at (but not EOF).
>
>I have a RequestLive, AutoCommit, tsCommitted setup; this whole thing is
>Local.
>
>I assume that I need to use UPDATE SQL to actually change the record,
>not post, but I'm really curious why this doesn't work and why the
>record seems to jump when POST is encountered in a debug session?

To be able to edit data you need either to have the RequestLive property set to True or, if
you NEED a special UPDATE statement for your edits (e.g. for a joined dataset) add that statement to the EditSQL property. For a simple select from one table, RequestLive is all you need and IBO will construct the UPDATE statement internally.

To put the dataset into Edit mode, call its Edit method.

If Autocommit is true, the call to Post will also commit the transaction. If you want to take explicit control of the transaction, Post will send the update to the server but won't save it. You must call the transaction's COMMIT method to save it; or ROLLBACK to undo it.

Cheers,
Helen

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