Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q236574

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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: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

				

↑ Back to the top


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.

↑ Back to the top


More information




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
				

↑ Back to the top


Keywords: kbqfe, kbado210fix, kbbug, kbfix, kbmdac250fix, kbmdacnosweep, kbqfe, kbhotfixserver, KB236574

↑ Back to the top

Article Info
Article ID : 236574
Revision : 6
Created on : 10/7/2005
Published on : 10/7/2005
Exists online : False
Views : 535