Subject Re: [IBO] How to Cancel a deleting
Author Harald Klomann
Jörg,

2.)

>> Type in your update statement in TIB_Query.DeleteSql
This will be the most easy and effective way, because it looks
to the user, like the record is deleted, but in fact it is only updated.
It would be a good idea, to make your select statement like :
select * from table where field <> 'DELETED', so after a refresh, this
records won´t appear in the grids ..

Harald



Harald Klomann wrote:
>
> Jörg,
>
> 2 possible solutions:
>
> 1.)
>
> assign a handler for BeforePost event.
>
> procedure qryBeforePost(IB_Dataset: TIB_Dataset);
> begin
> if IB_Dataset.State = dssDelete then begin
> // place your code for the update here
> ....
> ....
> // need to cancel the delete
> SysUtils.Abort
> end;
> end; {qryArtikelBeforePost}
>
> 2.)
>
> Type in your update statement in TIB_Query.DeleteSql
>
> Harald
>
> Jörg Schiemann wrote:
> >
> > Hi,
> >
> > what's the best way to cancel a deleting?
> > I still want to use TIB_UpdateBar.
> >
> > Purpose:
> > I don't want that any row can be deleted, instead I have a field 'DELETED'
> > which I want set to True.
> > Maybe it's no good habit (?) but I want to spare me some trouble with the
> > users.
> >
> > How are you handling it?
> >
> > TIA
> >
> > Jörg