Microsoft KB Archive/230101

= FIX: Data Queries Sporadically Return Empty Recordsets =

Article ID: 230101

Article Last Modified on 10/7/2005

-

APPLIES TO


 * Microsoft Data Access Components 2.0
 * 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 Q230101



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.



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.



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:

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

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



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.



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
 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. Download the hotfix (EmptyRS.exe) into a temporary directory and run it to extract the following files:

<ul> Msdaora.dll</li> Msdasql.dll</li> Msdasqlr.dll</li> Msdatl2.dll</li> Msdatt.dll</li></ul>

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

<div class="references_section">