Microsoft KB Archive/237276

= BUG: Preserve Recordset in Session State Yields Errors or Unexpected Results =

Article ID: 237276

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q237276



SYMPTOMS
When you use the "Preserve Recordset in Session State" option with the Visual InterDev 6.0 Recordset Design-Time Control (DTC), errors or unexpected behavior may occur.

You may encounter problems if you use more than one Recordset DTC on more than one Active Server Page (ASP) page if the Recordset DTCs are all set to Preserve Recordset in Session State and they all have the same name.

For example: Page1.asp contains a Recordset DTC named "Recordset1" that is set to Preserve Recordset in Session State, and Page2.asp also contains a Recordset DTC named "Recordset1" that is set to Preserve Recordset in Session State.

A common error associated with this scenario is:

ADODB.Fields error '800a0cc1'

ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application.

/_ScriptLibrary/Recordset.ASP, line 924

NOTE: The resulting problems are not limited to this error.



CAUSE
The Visual InterDev 6.0 Script Library names the session variable used to persist the recordset object uniquely for each Recordset DTC on a particular ASP page. However, it does not name the session variable uniquely for each Recordset DTC in an application.

For example, if two ASP pages in an application each have a Recordset1 object, the session variable used to persist these recordsets will be the same, and data may be overwritten.



RESOLUTION
To work around this problem, give a unique name to each Recordset DTC in an application that is set to Preserve Recordset in Session State.

For example, if Page1.asp has a Recordset DTC named "Recordset1" that is set to Preserve Recordset in Session State, and Page2.asp has a Recordset DTC that is also set to Preserve Recordset in Session State, name the Recordset DTC on Page2.asp something other than "Recordset1" (for example, "Recordset2").



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Keywords: kbbug kbctrl KB237276

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.