BUG: Client-Side Recordset DTC Fails if SOM Not Enabled

ID: Q192038


The information in this article applies to:
  • Microsoft Visual Studio 6.0


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 will be 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. Since the escape() function exists only in JScript, and the JScript engine is not referenced, then the escape() function is interpreted by the VBScript engine, resulting in the type mismatch.


RESOLUTION

To resolve this issue, a reference to the JScript engine must be placed on the Active Server Page. This can be accomplished 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:
    <%@ Language=Javascript %>


  • Open the Properties window for the page and click "Enable Scripting Object Model."


  • 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 this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words:

Keywords : kbCtrl kbVisID600bug kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: May 24, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.