If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Memory Leaks in ADO Execute method

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-17-02, 08:30
bmelnikov bmelnikov is offline
Registered User
 
Join Date: Dec 2002
Posts: 1
Memory Leaks in ADO Execute method

Hello All

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 ..."
m_Connect.Execute(sQuery)

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

rsResult.Close

End If

Set rsResult = Nothing

End If

but I still observe the memory leaks.

Second attempt was to tell to Connection object don't produce the Recordset:

m_Connect.Execute(sQuery, , ADODB.adExecuteNoRecords)

but this also didn't help me.

If I comment this line then the program stay on the same size in memory.

I test this problem with both "Microsoft OLE DB Provider for ODBC Drivers" and "Microsoft Jet 4.0 OLE DB Provider" providers.

Please help me to solve this problem. All sensible ideas will accepted with great thanks.

I use:

Windows 2000 Pro + SP3
Visual Basic 6.0 + SP5
ADO 2.7 Refresh (but 2.6 also produce same bug)
Access 2000

Best regards
Boris Melnikov
bmelnikov@hotmail.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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