[VCOM] when destroy cursor?

Ruslan Zasukhin sunshine at public.kherson.ua
Thu May 3 11:02:03 CDT 2007


On 3/5/07 6:48 PM, "YSD AG" <support at ysd.ch> wrote:

Hi Fabian,

> Hi Ruslan
> 
> A small question: I saw that a lot of:
> 
> ---
> Dim mycursor As VCursor
> Set mycursor=mydb.sqlselect(...)
> ... 
> Set Mycursor=Nothing (in VB6)
> ---
> 
> fragments the memory a lot. Would it be a better practise to declare a
> VCursor variable public and set the cursor to Nothing only at the end of the
> program:

No, because then may happens that second cursor will fails because first
still keep record locks

I wonder that memory on Windows is fragmented.
Why you think so?

Windows has page-based virtual memory,
This allow it fight against defragmentation.
 
> ---
> Dim globcursor As VCursor
> Set globcursor=mydb.sqlselect(...)
> ...
> Set globcursor=mydb.sqlselect(...)
> ...
> Set globcursor=mydb.sqlselect(...)
> ...
> Set globcursor=Nothing
> end
> ---
> 
> Or does this construct leaks memory?

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list