Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Memory Leak using ADO 2.6

I am using an ODBC connection to a proprietary database
to get data and then I put it in cells on the excel
spreadsheet. I have everything working fine, except
every time I call my query function Excel grows by 30 -
50k of RAM. It gets called every couple of seconds, so
this takes down excel fairly quickly.

I am pretty new to this Visual Basic VBA programming. Is
there some way to free a variable after it is allocated?

Here is the function I narrowed down to be the culprit -

Public Function SendQuery(QryString As String) As
Recordset
Dim PassCount As Integer
PassCount = 0
On Error GoTo QueryError

If Not Connected Then
QueryError:
PassCount = PassCount + 1
If PassCount <= 5 Then
ConnectToMonarch
Else
MsgBox "Unable to Query Monarch"
Exit Function
End If
End If

Set SendQuery = conn.Execute(QryString)

Exit Function

End Function

Any help will be greatly appreciated, Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Memory Leak using ADO 2.6

I would use either version 2.5 or 2.7 as I think there
are several problems with version 2.6. I have
experienced similar problems and this was resolved by
using 2.7.


-----Original Message-----
I am using an ODBC connection to a proprietary database
to get data and then I put it in cells on the excel
spreadsheet. I have everything working fine, except
every time I call my query function Excel grows by 30 -
50k of RAM. It gets called every couple of seconds, so
this takes down excel fairly quickly.

I am pretty new to this Visual Basic VBA programming.

Is
there some way to free a variable after it is allocated?

Here is the function I narrowed down to be the culprit -

Public Function SendQuery(QryString As String) As
Recordset
Dim PassCount As Integer
PassCount = 0
On Error GoTo QueryError

If Not Connected Then
QueryError:
PassCount = PassCount + 1
If PassCount <= 5 Then
ConnectToMonarch
Else
MsgBox "Unable to Query Monarch"
Exit Function
End If
End If

Set SendQuery = conn.Execute(QryString)

Exit Function

End Function

Any help will be greatly appreciated, Thanks.

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Memory Leak using ADO 2.6

Are you querying an open Excel workbook? If so you'll want to read:

Microsoft Knowledge Base Article - 319998
BUG: Memory Leak Occurs When You Query an Open Excel Worksheet Using ADO
http://support.microsoft.com/default...b;en-us;319998

"Jason" wrote in message ...
I am using an ODBC connection to a proprietary database
to get data and then I put it in cells on the excel
spreadsheet. I have everything working fine, except
every time I call my query function Excel grows by 30 -
50k of RAM. It gets called every couple of seconds, so
this takes down excel fairly quickly.

I am pretty new to this Visual Basic VBA programming. Is
there some way to free a variable after it is allocated?

Here is the function I narrowed down to be the culprit -

Public Function SendQuery(QryString As String) As
Recordset
Dim PassCount As Integer
PassCount = 0
On Error GoTo QueryError

If Not Connected Then
QueryError:
PassCount = PassCount + 1
If PassCount <= 5 Then
ConnectToMonarch
Else
MsgBox "Unable to Query Monarch"
Exit Function
End If
End If

Set SendQuery = conn.Execute(QryString)

Exit Function

End Function

Any help will be greatly appreciated, Thanks.

Reply
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
Excel 2007 Charts & Memory Leak?? Denis[_4_] Excel Worksheet Functions 0 April 20th 11 04:32 PM
XL 2007 - Out of Memory - memory leak/bug? PCLIVE Excel Discussion (Misc queries) 0 March 23rd 09 03:31 PM
Memory Leak in Excel ofra Excel Discussion (Misc queries) 0 August 28th 05 02:20 PM
Memory leak query Blue Aardvark Excel Discussion (Misc queries) 3 July 27th 05 09:01 AM
Out of Memory Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 4 June 1st 05 01:07 AM


All times are GMT +1. The time now is 05:42 PM.

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

About Us

"It's about Microsoft Excel"