Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Interrupting SQL-execution
Wed, Aug 1 2007 7:32 PMPermanent Link

"Henri Maas"
Hello all,

 Basic question i think.
 How can i properly interrupt (stop) a SQL-execution?
 Must i use Sql.Cancel? And in combination with what event?

 Thanks

Greetings
Henri
Thu, Aug 2 2007 4:50 PMPermanent Link

Eryk Bottomley
Henri,

>   Basic question i think.
>   How can i properly interrupt (stop) a SQL-execution?
>   Must i use Sql.Cancel? And in combination with what event?


Assign an OnQueryProgress event handler and set 'Abort' parameter to
True in order to cancel the query. Also, see Session.ProgressSteps as
this influences how often the event handler will be called.

Eryk
Thu, Aug 2 2007 5:01 PMPermanent Link

"Henri Maas"
Found out myself, see codefragment...

procedure TfrmMain.SQL1QueryProgress(Sender: TObject; PercentDone: Word;
 var Abort: Boolean);
begin
 Result1.Caption:=3D'Bezig... '+intTostr(Percentdone)+'% gereed';
 Result1.Update;
 application.ProcessMessages;
 abort:=3DSQL1stoppen;
end;

Thanks to the great helpfile of DBISAM (and DBsys as example).

CodeGear can take an example of that

Henri



 "Henri Maas" <info@epatech.nl> schreef in bericht =
news:44E650B0-984F-4154-AE1E-8B075A697898@news.elevatesoft.com...
 Hello all,

   Basic question i think.
   How can i properly interrupt (stop) a SQL-execution?
   Must i use Sql.Cancel? And in combination with what event?

   Thanks

 Greetings
 Henri
Thu, Aug 2 2007 6:06 PMPermanent Link

"Henri Maas"
Eryk,

 Thanks,  i figured it out myself and it's the same solution as you
suggested

Henri

"Eryk Bottomley" <no@way.com> schreef in bericht
news:70C6F07D-5DE4-468C-84D4-C3AE4D38B893@news.elevatesoft.com...
> Henri,
>
>>   Basic question i think.
>>   How can i properly interrupt (stop) a SQL-execution?
>>   Must i use Sql.Cancel? And in combination with what event?
>
>
> Assign an OnQueryProgress event handler and set 'Abort' parameter to True
> in order to cancel the query. Also, see Session.ProgressSteps as this
> influences how often the event handler will be called.
>
> Eryk

Image