ADO- complete Delphi example

Hello experts,

Problem desc:

- remote Firebird 1.5 server
- 'select * from TABLE'
- 78.567.678.12
- sysdba
- masterkeyxxx
- C:\Database.gdb
- query I am able to cancel at any given time

Question:
How can I do it (using ADO probably) i.e.

TADOConnection
TADODataset (maybe other components)

Thank you!
panJamesAsked:
Who is Participating?
 
Nick UpsonConnect With a Mentor Principal Operations EngineerCommented:
1.5 does not have a mechanism to stop a query running on the server

2.1 requires you to delete the correct record from rdb$transactions
0
 
Meir RivkinFull stack Software EngineerCommented:
can u be more clear as for what do you wish to see in the example?
0
 
Nick UpsonPrincipal Operations EngineerCommented:
the query will continue to run on the server, regardless of the client giving up on it, you need at least firebird 2.1 to be able to abort queries
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
panJamesAuthor Commented:
@sedgwick:

I would like to know exactly how to use ADO components to connect to a distant server, run a query but do not necessary wait until it completes- be able to abort the query on client side and/or server side.

@NickUpson:
If possible, could you please point out how to abort query on the client side and on the server side?

My database running on 1.5 but I guess it will be also well working on 2.1 <- am I correct here?

Thank you!
0
 
Ephraim WangoyaCommented:
Why dont you just call TADOConnection .Cancel
Assuming your query is running in some kind of thread and you have the opportunity to call the cancel method
0
 
panJamesAuthor Commented:
Ok, I am giving up the idea of canceling running query on the server side.
Is there any clever way of canceling query on the client side?

Thank you!
0
 
developmentguruConnect With a Mentor PresidentCommented:
When I need the ability to do this I run the query in a thread.  If I decide to stop waiting on the thread then the program continues as though the query were cancelled.  When the query finished then the thread would free itself, and the database resources.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.