BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cancel a TADOQuery-TProvider-TClientDataSet Open against MSS

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Dan Thomas
Guest





PostPosted: Thu Feb 12, 2004 9:11 pm    Post subject: Cancel a TADOQuery-TProvider-TClientDataSet Open against MSS Reply with quote



Preamble: I've done an exhaustive newsgroup search on this. I've spent weeks
trying different things I've read. I'm still stuck...

I have an application that has a TClientDataSet hooked to a TProvider hooked
to a TADOQuery. The query is running against an MSSQL 2K server. The result
set could be large, depending on what options the user specifies.

After I do ClientDataSet.Open (but before it returns), and after the
ADOQuery starts returning records, I'd like to be able to cancel the "Open"
(in other words, stop transferring records from the Server through the Query
into the CDS).

I almost got this to work right. I put code in the ADOQuery.AfterScroll
event that checks to see if the user clicked a Cancel button. If they did, I
call ADOQuery.Recordset.Cancel. This appeared to work, except for one thing:
it took just as long as if I hadn't canceled it. When I checked the network
Performance Monitor, it was obvious the ADOQuery was still retrieving
records from MSSQL.

I've read lots of stuff in these newsgroups about doing portions this. As
far as I can tell, none of the things I've read work against an MSSQL 2K
database.

If anyone has had success in doing this against an MSSQL 2K database, please
tell me how you did it. Tell me what properties you set, etc. I would be
sooooooo grateful!!!!

Dan Thomas

PS: If you can figure out how to cancel the ADOQuery before it starts
returning records, that would be cool also, but I've just about given up on
that (against an MSSQL 2K server).

PPS: Delphi 7 or 6.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.