Subject Re: Insert & then delete a row = "Unable to delete row"
Author Marco Menardi
--- In IBObjects@yahoogroups.com, "tickerboo2002" <support@t...> wrote:
> --- In IBObjects@yahoogroups.com, "Marco Menardi" <mmenaz@m...> wrote:
> > --- In IBObjects@yahoogroups.com, "tickerboo2002" <support@t...>
wrote:
> > > I'm using a TIB_Query to select a number of rows, insert a row and
> > > then delete that row and I get an exception "Unable to delete
row".
> > >
> > > Tracing into IBO, I see that I need to be out of dssInsert
state, so I
> > > called Search() prior to the delete. Now, it fails on the rowstate
> > > being rsNone.
> > >
> > > Should I be able to insert and then delete the newly inserted row
> > > within posting/commiting?
> > >
> >
> > Use ".Cancel" to cancel insert state (so you loose the "client side
> > only inserted record").
>
> OK, but If I've inserted 6 rows and then do a cancel, do I lose all
> six rows? I just want to delete one of the rows.
>

What about try by yourself? It's the fastest way to learn :)
If you press "cancel" you only "delete" the current, not posted row.
If you use "rollback", you tell the server to "cancle" all the work
done between the last "commit/commit retaining" and the new
"rollback". Post is different than commit, and Insert/modify is only a
client side state until you press post (or post is automatically done,
as when you change record in a ib_grid).
Remember that, until you post the record, what you see is a "client
only" buffer, that with "cancel" gets cleaned / restired to previous
state.
You could use the "ib_monitor" component, run in a separate non modal
window, to see what happens behind the scenes. To learn, use also the
various IB_bars to "manually" see and modify dataset state.
Best regards
Marco Menardi