Re: Cancelling an ADO Command takes too long
- From: "Guillem" <guillemvicens-nospam@xxxxxxxxxxxxxxxxxx>
- Date: 23 Nov 2006 03:02:49 -0700
Clayton Arends wrote:
The problem I have is that the cancel operation doesn't appear to be
cancelling the query at all. <snip>
Configuration
------------
I added a TADOConnection to the form and set ConnectOptions to
[coAsyncConnect]. I am using an Oracle 10G connection at my office
(using an Oracle OLEDB driver on my computer).
first question, are you sure Oracle accepts such a command? Just
asking, it's been years since I last worked with that db... :)
if (stExecuting in ADOCommand1.States) then
begin
Memo1.Lines.Add('Cancelling ...');
Memo1.Refresh();
ADOCommand1.Cancel();
Memo1.Lines.Add('Cancelled');
exit;
end;
ADOCommand1.CommandText := Edit1.Text;
ADOCommand1.Execute();
Memo1.Lines.Add("Executing ...");
So here is what I need to know. Have I configured my test correctly
to use asynchronous ADO? Is Cancel() always a blocking operation?
Is Cancel() optionally supported by the database? If the query is a
runaway query should Cancel() eventually come back?
AFAIK Cancel works if the method was called with adAsyncExecute,
adAsyncConnect or adAsyncFetch.
Said this, I'm not sure if regarding updates and depending on if you do
batch updates or not, it would work as you want. Maybe CancelBatch
would be better for that. See also CancelUpdate.
Check these URLs. You will find some examples
http://msdn2.microsoft.com/en-gb/library/ms677516.aspx
http://www.devguru.com/technologies/ado/QuickRef/command_cancel.html
http://www.w3schools.com/ado/met_cancel.asp
Good luck,
--
Best regards :)
Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
.
- Follow-Ups:
- Re: Cancelling an ADO Command takes too long
- From: Clayton Arends
- Re: Cancelling an ADO Command takes too long
- References:
- Cancelling an ADO Command takes too long
- From: Clayton Arends
- Cancelling an ADO Command takes too long
- Prev by Date: Re: Project using Firebird
- Next by Date: Re: ADOX set-up
- Previous by thread: Cancelling an ADO Command takes too long
- Next by thread: Re: Cancelling an ADO Command takes too long
- Index(es):
Relevant Pages
|