LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ADO Recordset using Excel as a database. Can't free the memory once opperation is over?

Hello.

Thanks for reading, hopefully one of you will have a suggestion.

I have 3 sheets of data in an Excel workbook. Those data where prevouisly
imported from an SQL database.

I need to perform many filtering opperation on those datas to fill different
tables with the numbers of rows left after the
filter is applied.

After creating a connection object and a recordset, i pass the recordset to
a funtion. Here is a portion of this funtion.

With rstX
If .State = adStateClosed Then
.Source = strSql ----------------- exeample "SELECT *
FROM [Data1$] Where RefCat IN (2,5,10,15)"
.Open , , adOpenStatic, adLockReadOnly
End If
End With
For i = 1 To 3
rstX.Filter = "Date='" & CLng(Fonctions.Cells((5 + i),
3).Value) & "' And Date<='" & CLng(Fonctions.Cells((5 + i), 4).Value) & "'"
tabRange.Cells(j, (i * 2)).Value = rstX.RecordCount
Next i
rstX.Close

The funtion retuns an integer indicating if the opperation was successfull.

After all the filter are over the calling sub puts the recordset object and
the ado connection to nothing.

I call this function over 40 in the same event ( click of a button )

My problem comes with the memory usage. For some reason excel seems to store
the result set of all the Select .
When i'm done excel use 110 megs of memory and if i start the opperation
again it will build up more memory until the available memory is full.

It wont free that memory until i close Excel itself, closing the workbook
does not do it.

Thank you !

--
Denis Béland





--
Denis Béland




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex search, copy, and move opperation. Please HELP!!! Redoctober Excel Discussion (Misc queries) 3 September 9th 08 11:48 PM
Fixed vlaue in the Fill handle opperation BrusPB Excel Discussion (Misc queries) 2 July 18th 07 01:02 PM
Way to free memory as I input lines from a file? Steven Douglas Excel Programming 1 September 2nd 04 12:58 PM
In Memory Recordset Without Creating Database Alok Joshi Excel Programming 3 July 26th 04 08:41 AM
free up memory by deleting variables clui[_11_] Excel Programming 4 December 11th 03 01:10 AM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"