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: Data Queries Sporadically Return Empty Recordsets


View products that this article applies to.

Symptoms

Services or applications using ActiveX Data Objects (ADO) 2.0 or greater may intermittently return empty recordsets on queries that should be returning valid results. At the time the problem occurs, the same queries successfully return the expected data when run from non-ADO sources, such as from ISQL in Microsoft SQL Server. This problem predominantly occurs on multi-processor computers but has also been known to occur on single-processor computers.

As a side effect, the following error may also occur if the application tries to use the empty recordset:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record.
If the application or service is allowed to continue processing, the recordsets will eventually begin to come back empty all the time. There are no error messages returned to the client to indicate that there is a problem, and no errors are written to the Event Log. Tracing utilities such as ODBC Trace will show that data was successfully returned to the application.

↑ Back to the top


Cause

A memory leak caused by a buildup of Critical Section objects is causing fragmentation. Eventually, there is not enough contiguous memory left for the OLE DB providers to allocate what is required by the returning recordsets.

Because the first attempt to fetch a recordset happens when checking the recordset's EOF property, and because ADO only checks for a boolean True/False value on the EOF property, the E_OUTOFMEMORY return code that is passed back by the providers is ignored, and the EOF property is set to True.

↑ 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 2.1 Service Pack 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     
   ----------------------------------------------------

   6/3/99            02.10.4204   184 KB    Msdaora.dll
   6/3/99            02.10.4204   583 KB    Msdasql.dll
   6/3/99            02.10.4204    10 KB   Msdasqlr.dll
   6/3/99            02.10.4204   155 KB    Msdatl2.dll
   6/3/99            02.10.4204    87 KB     Msdatt.dll
				




WORKAROUND

In addition to the hotfix mentioned above, please implement the following workaround:
  1. Apply the Maxblock registry fix mentioned in the following article in the Microsoft Knowledge Base:
    193026 PRB: NOT_ENOUGH_STORAGE Errors in IIS Log File
    Note that the MaxBlock.reg must be applied, irrespective of the MDAC version.
    IMPORTANT: Please do NOT install the hotfix that is mentioned in article Q193026! Application of the MaxBlock.reg file is all that is required.
  2. Upgrade to Windows NT 4.0 Service Pack 5, or apply the Ntdll.dll hotfix required to fix memory-related problems. For additional information about this hotfix, please see the following article in the Microsoft Knowledge Base:
    216383 Memory Allocations May Fail When There Are Large Free Blocks
Additionally, please follow the general troubleshooting tips provided in the following articles in the Microsoft Knowledge Base:
197449 PRB: Problems Reusing ADO Command Object on Multiple Recordsets
176056 INFO: ADO/ASP Scalability FAQ

↑ 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 ActiveX Data Objects versions 2.1 SP 2 and later.

↑ Back to the top


More information

This hotfix does NOT contain a fix for the critical section leak. This hotfix contains changes to provider-shared code that will prevent the fragmentation that leads to the empty recordsets, and is intended to provide some relief for severe cases of this problem. These changes will significantly extend the time-to-failure of the application or service. The changes in this hotfix as well as a fix for the critical section leak will be released with Microsoft Data Access Components (MDAC) 2.1 SP2.

In addition to the provider-shared code changes, this hotfix contains the OLE DB Provider for ODBC and the Oracle provider. These providers have been modified to accommodate the changes made in the shared code. At this time, the provider for SQL Server (SQLOLEDB) has not been modified to accommodate these changes. While it is unlikely that any serious problems will occur, it is recommended that the other providers be used instead. Changes to the SQL Server native provider are currently being addressed.

Important Notice for Microsoft Windows 95/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 will need to install the Windows 98 Migration DLL included with this fix. Please carefully read the Migrate_qfe.txt file that is included Migration.exe file included with the download.

Manual Installation

  1. Close or stop any applications or services that are known or suspected to be using the files listed above. This may include Microsoft Internet Information Server (IIS), Microsoft Transaction Server (MTS), Microsoft Distributed Transaction Coordinator (DTC), and any ADO or OLE DB applications.
  2. Download the hotfix (EmptyRS.exe) into a temporary directory and run it to extract the following files:

    • Msdaora.dll
    • Msdasql.dll
    • Msdasqlr.dll
    • Msdatl2.dll
    • Msdatt.dll


  3. Locate and rename the current versions of these files, which should exist in the Program files\Common files\System\OLE DB folder.
  4. Copy the hotfix version of these files into the same location, reregister them, and restart your services and applications.

↑ Back to the top


Keywords: kbqfe, kbbug, kberrmsg, kbfix, kbmdac210sp2fix, kbmdacnosweep, kbhotfixserver, KB230101

↑ Back to the top

Article Info
Article ID : 230101
Revision : 7
Created on : 10/7/2005
Published on : 10/7/2005
Exists online : False
Views : 567