BUG: Preserve Recordset in Session State Yields Errors or Unexpected Results (237276)



The information in this article applies to:

  • Microsoft Visual InterDev 6.0

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.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbCtrl kbDSupport KB237276