Depends on how you get the RecordSet, and what the variable type is:

var
  rs : OLEVariant;
begin
  rs := ADOConn.execute("select * from blah");

  //use it

  rs  := nil; //or unassigned?
end;

should work OK. If in doubt, step thru your code and use the CPU view -
there should be fairly obvious references to code that dec's the reference
count at the end of the method.

If, however, you do a

rs := TMSRecordSet.create();

you might have to release it. The main difference  is that one is a handle
to an interface, and the other is an object (which may or maynot implement
an interface)

Nic.
--
Nic Wise - 021.676.418 / [EMAIL PROTECTED] / Inprise/Borland New Zealand
Is it not a foolish man, said little Woo, who keeps all his chickens in his
trousers?
For at best, will he not suffocate his chickens, and, and worst, will he not
disappoint the ladies in the village?  --Alexi Sayle





> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Blackie, Nikolai
> Sent: Friday, 5 May 2000 15:04
> To: Multiple recipients of list delphi
> Subject: [DUG]: ADO recordset = nil
>
>
> When recordset objects go out of scope does Delphi clean them up? Is there
> an advantage to explicitly setting RS objects to nil as done in VB?
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to