My program receives the messages from some hardware and store data in the database (i.e.this work in very high speed). In the Windows Task Manager I see that size of my program in the memory grows consistently. This memory never bacK! The line in my
code, causing the memory leaks, is a call to Execute method of Connection object:
Private m_Connect As ADODB.Connection
Dim sQuery As String
sQuery = "INSERT INTO ..."
The Execute method retrieves the Recordset object, so my first attempt the solve this issue was to receive this Recordset and close it:
Dim rsResult As ADODB.Recordset
Set rsResult = m_Connect.Execute(sQuery)
If (Not (rsResult Is Nothing)) Then
If (rsResult.State = ADODB.adStateOpen) Then
Set rsResult = Nothing
but I still observe the memory leaks.
Second attempt was to tell to Connection object don't produce the Recordset: