Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Complex search, copy, and move opperation. Please HELP!!! | Excel Discussion (Misc queries) | |||
Fixed vlaue in the Fill handle opperation | Excel Discussion (Misc queries) | |||
Way to free memory as I input lines from a file? | Excel Programming | |||
In Memory Recordset Without Creating Database | Excel Programming | |||
free up memory by deleting variables | Excel Programming |