Re: TADOStoredProc




Using TADOStoredProc I usually write the following code:
SP1.Parameters.ParamValues['@Param'] := 20;
with SP1 DO
BEGIN
OPEN;
BLAH BLAH
CLOSE;
END;

My question is do I need to close the result set at the end and
should it be in a finally clause? I see others actually close before they open, is this needed? Will not closing cause performance issues?

Likewise for TADOQuery, do you have to set Active to false and close or is there no need to bother?

If the TadoQuery is open already changing the parameter will not retrieve new
data
You can use the REQUERY method which is faster than Close/open
So I would rewrite your code

with SP1 DO
BEGIN
Parameters.ParamValues['@Param'] := 20;
If Active then
requery
Else
OPEN;
BLAH BLAH

END;
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.



Relevant Pages

  • BSOD Kernel_data_inpage_error win32k.sys
    ... I get a BSOD saying Kernel_data_inpage_error and referencing ... blah blah something about shutting down in 60 seconds and then - ... shouldn't happen again but if it does to contact my hard disk manufacturer. ... I've already done a Repair install with my XP SP1 cd thinking that would fix ...
    (microsoft.public.windowsxp.general)
  • TADOStoredProc
    ... Using TADOStoredProc I usually write the following code: ... with SP1 DO ... BLAH BLAH ... do you have to set Active to false and close or is there no need to bother? ...
    (borland.public.delphi.database.ado)