Re: Cancelling an ADO Command takes too long



Brian,

Your original question references AdoCommand which does not return a
recordset

It does so through the use of TADOConnection::OnExecuteComplete which is
where one can assign the result set to a TADODataSet or iterate the
_Recordset on one's own. Another way (which I have not tried yet, only
looked at in research) is to use the result of TADOCommand::Execute() and
not iterate through it until its State property is adStateOpen.

If you are using TadoDataset or TadoQuery to return the select then you
would
use Adodataset1.recordset.cancel to cancel Asyncronous execution.

I'm already familiar with canceling queries that are in the process of
fetching the data (thanks for the info again, though) ;-). The problem I'm
trying to overcome is canceling queries that have not yet returned anything.
Those where the server is still crunching away on the query itself rather
than returning results. I'm sure there is a word for this state but I don't
have it in my lexicon. I guess in ADO terms that would be "executing" as
opposed to "open" or "fetching".

I did a lot more digging in Google since my last post here using some
different search criteria than before. I tracked down dozens of posts with
titles like "How to cancel ADO query in Oracle?" From what I've seen it
appears that Oracle does not support canceling a query in this manner (7
through 9i were mentioned). Apparently the Oracle way of doing things is
through another session (at least in ADO, I'm not sure if this is supported
using native drivers).

I might have to go to plan B. My actual product is a multi-tier app in
which the server is responsible for the ADO communications. I already offer
the ability for admins to close active connections against my server. One
of the only situations where this doesn't work is when an ADO query is
active. The inability for me to consistently be able to cancel an ADO query
means that I'll need to create the option for the code to orphan active ADO
connections and queries if they are in the above mentioned state. This will
allow my program to cancel the active query as far as the client is
concerned and still be able to clean up the ADO connection if the query ever
does return. This isn't my favorite solution but it does allow me a little
more freedom.

- Clayton


.



Relevant Pages

  • Cancelling an ADO Command takes too long
    ... I have created an application to test asynchronous operations in ADO to ... The problem I have is that the cancel operation doesn't appear to be ... The amount of time that the query I am using ... and reduced the CommandTimeout of both the command and the connection ...
    (borland.public.delphi.database.ado)
  • Cancelling query with ADO and Oracle
    ... I am running a VB.NET application which is using ADO to connect to an Oracle ... I have a form which runs a query which can take a considerable ... The user can cancel the execution of this query at any time by ...
    (microsoft.public.dotnet.framework.adonet)
  • Cancelling an ADO query with Oracle
    ... I am running a VB.NET application which is using ADO to connect to an Oracle ... I have a form which runs a query which can take a considerable ... The user can cancel the execution of this query at any time by ...
    (microsoft.public.dotnet.general)
  • Re: Cancelling query with ADO and Oracle
    ... Are you concerned about cancelling the calling thread or oracle execution? ... If you want cancel the operation on Oracle - then yes, ... This query is run ... > My question is how to terminate this long running query through ADO? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Parent/Child Relationship to Integrate Data in Reports
    ... I am working on updating my queries but am confident ... On the code to cancel the before update ... Create a query joining the projects and expenses tables. ... Join ProjectID from one table to ParentProjectID in the other. ...
    (microsoft.public.access.reports)