FIX: Data Queries Sporadically Return Empty Recordsets
ID: Q230101
|
The information in this article applies to:
-
Microsoft Data Access Components versions 2.0, 2.1, 2.1 (GA), 2.1 SP1
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 that corrects this problem is now available from Microsoft, but
it has not been fully regression tested and should be applied only to systems
experiencing this specific problem. If you are not severely affected by this
specific problem, Microsoft recommends that you wait for the next Microsoft Data Access Components 2.1 Service Pack
that contains this fix.
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 on support costs, please go to the following
address on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
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:
Q193026 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:
Q216383 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:
Q197449 PRB: Problems Reusing ADO Command Object on Multiple Recordsets
Q176056 INFO: ADO/ASP Scalability FAQ
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products 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:
- Msdaora.dll
- Msdasql.dll
- Msdasqlr.dll
- Msdatl2.dll
- Msdatt.dll
- Locate and rename the current versions of these files, which should exist in the Program files\Common files\System\OLE DB folder.
- Copy the hotfix version of these files into the same location, reregister them, and restart your services and applications.
REFERENCES
For more information, please see the following articles in the Microsoft Knowledge Base:
Q193026 NOT_ENOUGH_STORAGE Errors in IIS Log File
Q216383 Memory Allocations May Fail When There Are Large Free Blocks
Q197449 PRB: Problems Reusing ADO Command Object on Multiple Recordsets
Q176056 INFO: ADO/ASP Scalability FAQ
Additional query words:
return empty recordsets no rows results ADO IIS MTS data connection backend begin valid queries components EOF
Keywords : kberrmsg kbADO kbMDAC kbGrpMDAC kbMDAC210SP2fix
Version : WINDOWS:2.0,2.1,2.1 (GA),2.1 SP1
Platform : WINDOWS
Issue type : kbbug