Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
FIX: Aggregating ADO Recordsets or Commands May Cause Memory Leak
Article ID: 283106 - View products that this article applies to.
This article was previously published under Q283106
If a Visual C++ application or dynamic-link library (DLL) aggregates ActiveX Data Objects (ADO) Recordset or Command objects, a significant memory leak can occur due to resources that are not freed when the Release function is called on the object.
This occurs in all versions of ADO prior to and including version 2.6 RTM (2.60.6526).
Aggregation in Recordset and Command objects is implemented by using the CComAggObject classes in Active Template Library (ATL). CComAggObject deletes itself when its reference count goes to zero, and simply deletes the Recordset or Command object as well. The Recordset or Command object's Term function is never called, which is where the clean-up of allocated resources occurs.
MDACTo resolve this problem, obtain the latest service pack for Microsoft MDAC 2.5. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
293312This problem was corrected in Microsoft Data Access Components 2.6 Service Pack 1.
(http://support.microsoft.com/kb/293312/EN-US/ )INFO: How to Obtain the Latest MDAC 2.5 Service Pack
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
300635The English version of this fix should have the following file attributes or later:
(http://support.microsoft.com/kb/300635/EN-US/ )INFO: How to Obtain the Latest MDAC 2.6 Service Pack
Date Version Size File name ------------------------------------------------------------ 12/14/2000 2.53.6013.0 20,480 bytes Msader15.dll 12/14/2000 2.53.6013.0 491,792 bytes Msado15.dll 12/14/2000 2.53.6013.0 172,304 bytes Msadomd.dll 12/14/2000 2.53.6013.0 57,616 bytes Msador15.dll 12/14/2000 2.53.6013.0 188,688 bytes Msadox.dll 12/14/2000 2.53.6013.0 57,616 bytes Msadrh15.dll 12/14/2000 2.53.6013.0 94,480 bytes Msjro.dll 12/22/2000 824,744 bytes Q283106_w2k_sp3_x86_en.exe
MDACMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft MDAC 2.5 Service Pack 3. This problem was first corrected in Microsoft Data Access Components 2.6 Service Pack 1.
Windows 2000Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This behavior is likely to be seen only when the application has been written in Visual C++, and when the developer deliberately aggregates Recordset or Command objects. This behavior does not occur in Microsoft Visual Basic applications, because aggregation is not possible from Visual Basic.
The MDAC 2.5 version of this hotfix can be applied over both 2.5 RTM (2.50.4403) and 2.5 SP1 (2.50.5303).
Steps to Reproduce Behavior
Article ID: 283106 - Last Review: September 26, 2005 - Revision: 3.2