BUG: Client-Side Recordset DTC Fails If SOM Is Not Enabled (192038)



The information in this article applies to:

  • Microsoft Visual Studio, Enterprise Edition 6.0

This article was previously published under Q192038

SYMPTOMS

If a Recordset Design-Time Control (DTC) is placed on an Active Server Page (ASP) without enabling the Scripting Object Model (SOM), the Recordset DTC may fail, and no data is returned. Instead, the following error is returned either to the browser or when the source for the page is viewed in the browser (that is, "View Source"):
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'Recordset1'

CAUSE

The code generated for the client-side Recordset DTC is written in JScript (JavaScript). The source includes a call to the escape() function to ensure that paths to databases that include backslash characters (for example, "\\myserver\myshare\mydata.mdb") are interpreted appropriately.

If the default language for the Active Server Page is VBScript (VBScript is the default value), and there is no reference to JScript on the page, then the JScript engine will not be referenced when the page is interpreted. Because the escape() function exists only in JScript, and the JScript engine is not referenced, the escape() function is interpreted by the VBScript engine, which results in the type mismatch.

RESOLUTION

To resolve this issue, you must place a reference to the JScript engine on the Active Server Pages (ASP) page. This can be accomplished in one of three ways:
  • Open the Properties window for the page, and change the Default Scripting Language for the Server to Javascript. This can also be accomplished by updating the @Language directive to JavaScript as in the following code:
    <%@ Language=Javascript %>
    					
  • Open the Properties window for the page, and select the Enable Scripting Object Model check box.
  • Add a "dummy" JavaScript reference to the page. For example:
         <SCRIPT Language=Javascript Runat=Server>
    
           function dummy_function() {
           }
         </SCRIPT>
    					
Any of these resolutions will reference the JScript engine, and the page will function properly.

STATUS

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

Modification Type:MinorLast Reviewed:8/12/2005
Keywords:kbBug kbCtrl KB192038