Re: TADOStoredProc
- From: Brian Bushay TeamB <BBushay@xxxxxxxxx>
- Date: Wed, 16 Aug 2006 20:46:52 -0500
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
.
- References:
- TADOStoredProc
- From: Paul Smith
- TADOStoredProc
- Prev by Date: Re: ConnectionString for Oracle
- Next by Date: Re: ConnectionString for Oracle
- Previous by thread: Re: TADOStoredProc
- Next by thread: ConnectionString for Oracle
- Index(es):
Relevant Pages
|