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 

Re: freeing a recordset

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





PostPosted: Fri Aug 06, 2004 10:09 am    Post subject: Re: freeing a recordset Reply with quote



Quote:
recordset := myFunc;
No, assigning this way will release current recordset and assign new


Quote:
myProcedure(var recordset: _Recordset)
Probably yes, especially if myProcedure is from WinAPI or from any MS code -

it could expect that you will release recordset.

Quote:
do I need to free the recordset after closing the form..?
No, form variables will be released, including strings, variants and

interfaces.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Gary" <nomail (AT) nomail (DOT) com> сообщил/сообщила в новостях следующее:
news:41133006$1 (AT) newsgroups (DOT) borland.com...
Quote:

hi,

I am assigning a recordset (_recordset) from
a datamodule like this:

with myAdodataset do begin
close ;
recordset := myFunc;
open ;
end ;

My question is: Do I need to set the recordset to nil before
assigning a fresh recordset from the function. I am worried
that I am not freeing resources properly. And do I need to free the
recordset after closing the form..?

Thanks.



Back to top
danny heijl
Guest





PostPosted: Fri Aug 06, 2004 7:40 pm    Post subject: Re: freeing a recordset Reply with quote



Viatcheslav V. Vassiliev schreef:

Quote:

No, assigning this way will release current recordset and assign new


But I found that if you do not call Close on the _recordset you will
leak memory like mad.

Danny
---

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.