Solved

Stoping a query in the middle...

Posted on 2001-07-27
6
203 Views
Last Modified: 2010-04-06
Hello!
I am writing a database program using ADO and I want
to have a stop button that will be able to stop a query in the middle (If it is taking too long, and the user decide to cancel the query...).
Everything I tried so far faild, and I have no more ideas.
Does anyone knows how can it be done???
10X a lot,
Inbal.
0
Comment
Question by:iofek
6 Comments
 

Expert Comment

by:syloux
ID: 6328077
listening...
0
 
LVL 6

Expert Comment

by:edey
ID: 6328117
I don't do any DB stuff, but this article looked promising: http://groups.google.com/groups?hl=en&safe=off&th=46963f664d27dde0,2&seekm=3b38f20e_1%40dnews#p

GL
Mike
0
 
LVL 1

Expert Comment

by:bnemmers
ID: 6328274
Make sure you set the ExecuteOptions of the ADOQuery to
include eoAsyncFetch. If you don't you will not get the event OnFetchProgress.

Bill.
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Accepted Solution

by:
FrodoBeggins earned 50 total points
ID: 6329456
There is a brute force method. Run the query in a thread and kill the thread whenever you want. In fact, you need to run it in a thread anyway, or the STOP button will not react.
But I hope there is a better way
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6342158
Listening ...
0
 

Author Comment

by:iofek
ID: 6381410
well, I hoped there will be a better way but it seems like
there isn't so thanks anyway. I guess it still gonna work...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question