Subject Re: [IBO] How to let the user know the system is working on a DELETE?
Author Helen Borrie

At 04:16 AM 4/02/2006, you wrote:
>I'm trying to show the user that something is happening while a DELETE
>is occurring.
>Recently, I posted my problems with using OnCallBack from a IB_Datapump
>to drive a progress bar. Although it worked fine in IB_SQL's datapump
>and I tried to mimic that code in my application, all it would do is
>catch the first 100 of about 700 records to process then stop all
>progress bar update. (Thanks, Set for your cleanup of my DELETE)
>My next attempt has been to use a TAnimate of the standard File Delete
>AVI. This is supposed to be asynchronous. I start it before the DELETE,
>but once the ExecSQL starts, it stops dead.
>Does anyone know how to correct any of these issues or know of another
>way to let the user know that something is going on while I DELETE items
>in a large file?
>Thank you for your help,
>Chuck Belanger
>Below is my most recent code for the TAnimate (actually TJvAnimate) with
>the DELETE:

First, take on board what Jason said about callbacks: they are a
client-side concoction that can intervene between FETCHES for a
SELECT statement. They're not applicable for DML, since the database
engine doesn't do callbacks at all (except for events, of course, but
that's not applicable here either). After whacking off a DML
statement, the client won't know what's going on at the server until
the statement request either completes or excepts.

If you wanted to count the individual operations, you'd have to
refactor your code so that each hit on a record goes across as a
request that is targeted at one and only one row. That's highly
undesirable: you want your batch operations to be fast!

You *can* employ the BusyCursor, to replace the normal cursor while
the application is waiting for the batch operation to complete. IBO
has its own BusyCursor that you can use; Delphi has its standard SQL
cursor for this purpose; or, if you want something highly unusual to
show to your users as a BusyCursor, you can define your own glyph in
your resources to use for this. (I don't know whether
TIB_ScreenCursor could support an animated gif, though...maybe you
can find a screencursor-compatible animated thingy somewhere in the JVCL...)

You'll need a TIB_SessionProps to set all of this up. I suggest
studying all of the bits and pieces of help for BeginBusy, EndBusy
and BusyCursor as a start point for designing your feedback mechanism.