Microsoft KB Archive/236574

= FIX: Memory Leak When Field in Recordset Has More Than 16K of Data =

Article ID: 236574

Article Last Modified on 10/7/2005

-

APPLIES TO


 * Microsoft OLE DB 2.1
 * Microsoft Data Access Components 2.1
 * Microsoft Data Access Components 2.1 Service Pack 2
 * Microsoft Data Access Components 2.1 Service Pack 1

-



This article was previously published under Q236574



SYMPTOMS
When using a Recordset that has been created by appending fields to a Recordset object (a "creatable" recordset), and when any text fields in the recordset contain more than 16K of data, a memory leak occurs when setting the value of the field. The memory leak occurs regardless of what the field's Size property has been defined to be, as long as the size of the actual data is more than 16K.



CAUSE
When the amount of data being assigned to a field value is more than 16K, the Data Conversion Library creates a scratch buffer to work with. The buffer is not released.



RESOLUTION
A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Microsoft Data Access Components Service Pack 3 that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:

  Date      Version      Size    File name ---

7/2/99   02.10.4302   359KB   oledb32.dll



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This problem has been fixed in Microsoft Data Access Components version 2.5.



Manual Installation

 * 1) Close or stop any applications or services that are using the oledb32.dll file. This may include Internet Information Server (IIS), Microsoft Transaction Server (MTS), Microsoft Distributed Transaction Coordinator (DTC), and any ActiveX Data Objects (ADO) or OLE DB applications.
 * 2) Download the hotfix version of oledb32.dll into a temporary directory.
 * 3) Locate and rename the current version of oledb32.dll, which should be in the \Program Files\Common files\System\ole db folder.
 * 4) Copy the hotfix version of oledb32.dll into the same location, and restart your services and applications.

Important Notice for Microsoft Windows 95 and Windows 98 Users
If you are installing this fix onto a computer running Windows 95 or a computer with the original release of Windows 98, you may need to install the Windows 98 Migration DLL included with this fix. Please carefully read the Migrate_qfe.txt file that is included in the Migration.exe file, which is included with the download.

Steps to Reproduce Behavior
To reproduce the memory leak, copy the following code and paste it into a Visual Basic project.

NOTE: Start the Performance Monitor and watch the Private Bytes counter for the process while running the code.

Please note that it does not make any difference what the field's Size property has been defined to be.

Sub TestRS Dim rs As New ADODB.Recordset Dim str1 As String

str1 = String(8200, "a") rs.Fields.Append "F1", adBSTR, 100 rs.Open

For i = 0 To 50 rs.AddNew rs.Fields(0) = str1  '<--memory leak occurs here rs.Update Next

Set rs = Nothing End Sub

Additional query words: memory leak append createable recordset more than 16 K data conversion library oledb32.dll

Keywords: kbbug kbfix kbmdac250fix kbqfe kbado210fix kbmdacnosweep kbhotfixserver KB236574

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.