Solved

Stoping a query in the middle...

Posted on 2001-07-27
6
201 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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