Re: ADO Performance / Optimize?

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 07/14/04


Date: Tue, 13 Jul 2004 20:05:44 -0500


> CPXML_DATA.DM.CP_Query.SQL.Clear;
> CPXML_DATA.DM.CP_Query.SQL.Text := SQLStatement;
> CPXML_DATA.DM.CP_Query.Active := True;
> Result := CPXML_DATA.DM.CP_Query.FieldByName('specimen_id').AsString;
> CPXML_DATA.DM.CP_Query.Active := False;
> CPXML_DATA.DM.CP_Query.SQL.Clear;
> End;
>
>
>
>I'm posting this because I hope you'll take notice of the ACTIVE = TRUE and
>then ACTIVE = FALSE commands that I use. Is there a better way? Do I really
>need to active / inactivate the query component each time? Or can I leave
>the query active the entire time, and just execute it?

If you use a parameter in your query you can change the parameter and use the
Requrey method which will be a lot faster than what you are doing.

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com


Relevant Pages

  • Re: Struts - Getter method
    ... group loves source code, as a rule. ... posting the code then. ... but it's not a collection of type Book. ... Query, while creating ...
    (comp.lang.java.programmer)
  • Re: Struts - Getter method
    ... group loves source code, as a rule. ... posting the code then. ... Query, while creating ... instances of type Book and setting the attributes of each instance ...
    (comp.lang.java.programmer)
  • Re: no responses...
    ... so again your posting hasn't gone astray. ... I was in frequent touch for all the excel help i needed untill now, ... "Kicking Out" Inactive Users / Help!!! ... I did also send a query on knowing how to scroll a message in a text box ...
    (microsoft.public.excel.misc)
  • Re: WH_JOURNALRECORD not working correctly.
    ... Hello and thank you very much for looking at my query. ... After a lot of messing around and posting to this newsgroup I have found out ... software on the origional PC and now the hook functions correctly. ... You can send feedback directly to my manager at: ...
    (microsoft.public.win32.programmer.ui)
  • Re: Select question
    ... Posting CREATE TABLEs, INSERTs for sample data and expected ... do have in common: SQL. ... >but if table is derived you can't create the same query ... still find SQL Server's optimizer producing odd-looking plans. ...
    (microsoft.public.sqlserver.programming)