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: "Rowset Cannot Be Loaded Because the Stream Is Invalid" Error Occurs When You Marshal an Array of Recordsets


View products that this article applies to.

Symptoms

When you use the Windows 2000 release of MDAC 2.5 (version 2.50.4403) and you marshal a variant array that contains two or more ActiveX Data Objects (ADO) recordsets, the following error may occur:
Run-time error '-2147024846 (80070032)
Rowset cannot be loaded because the stream is invalid.
This error occurs in a completely random and unpredictable fashion. Its occurrence depends on the data in the stream that is being marshaled.

↑ Back to the top


Cause

When a rowset is read into the client application, an internal buffer is used to contain data from the stream. Each rowset stream contains a token at the beginning that identifies the nature of the stream. When the rowset is of just the right size so that the token for the next rowset is broken up across the end of the buffer, the buffer must be refilled to collect the rest of the token. However, the pointer is not being correctly repositioned to the beginning of the rowset.

↑ Back to the top


Resolution

To resolve this problem, you can either:
  • Obtain the latest service pack for Windows 2000. For additional information, please see the following article in the Microsoft Knowledge Base:
    260910 How to Obtain the Latest Windows 2000 Service Pack
  • Obtain the following hotfix:

    A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Data Access Components 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    
       -----------------------------------------------------
    
       4/4/00    2.50.5110.3   147,728 bytes     msadco.dll
       4/4/00    2.50.5110.3    57,616 bytes     msadcs.dll
    
    						

    NOTE: The installer package for this hotfix (Q257953_W2K_SP1_x86_en.exe) is designed to run on Windows 2000 platforms, and will not run on NT 4.0 or Windows 95/98 platforms. For this reason, two additional files, RDSHotfix.exe and RDSHotfix.zip, are included to facilitate placement of the hotfix on Windows NT 4.0/WinDows 95/98 platforms. RDSHotfix.exe is a self-extracting executable that has had the default unzip directory set to the correct location for the files it contains. It can be run with the -auto switch when no user input is desired. All of these packages contain the same files, which have the attributes indicated in this section.

Workaround

To work around this problem, use any of the following methods:
  • Return a single rowset from the method, rather than an array of rowsets.
  • Rearrange the order of the rowsets in the array so that the rowset causing the problem is the last rowset in the array. This would generally require that you know which rowset is generating the error, however, and it might still not completely avoid the problem.
  • Separate the recordsets with other variant objects, such as character strings.

↑ 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 was first corrected in Windows 2000 Service Pack 1.

↑ Back to the top


Keywords: KB257953, kbwin2000sp1fix, kbqfe, kbfix, kberrmsg, kbbug, kbqfe, kbhotfixserver

↑ Back to the top

Article Info
Article ID : 257953
Revision : 6
Created on : 10/12/2005
Published on : 10/12/2005
Exists online : False
Views : 446