Microsoft KB Archive/190940

= BUG: JScript Compilation Error '800a03ec' Expected ';' =

Article ID: 190940

Article Last Modified on 2/11/2005

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q190940



SYMPTOMS
On an Active Server Pages (ASP) page with a Grid you get the following error:

Microsoft JScript compilation error '800a03ec'

Expected ';'

/ShipTest/_ScriptLibrary/DataGrid.ASP, line 197

On a DHTML page with a Grid, only the navbar and paging information (Page x of n) appears. Or as a DHTML page is loading you get an "Internet Explorer Script Error" dialog box containing text that is similar to the ASP error above.



CAUSE
This error occurs because an apostrophe was entered in the Header for the Grid. The header input text box can be found on the Custom property pages of the Grid on the Data tab in the Edit columns section.

The Grid is implemented in JavaScript. In JavaScript the apostrophe (') is a string delimiter as is a double-quote ("). The Grid uses apostrophes as string delimiters internally.



RESOLUTION
To get an apostrophe to appear in the Header of the grid you need to put two backslash (\\) characters before an apostrophe. This will cause the apostrophe to appear as you would expect. This is also known as escaping the apostrophe (see below for more information on escaping in JavaScript and the DTC Grid).



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
Normally in JavaScript you would need only one backslash (\) to escape an apostrophe. In this case you need two because the string is processed twice: first when it is evaluated as a JavaScript expression and second when it is stored as a string using apostrophes as delimiters. If you type in Name\\'s it is processed once and stored in the Grid's internal properties as "Name\'s'. This will be put into the Grid as Name's, which is what we want.

Steps to Reproduce Behavior

 * 1) Place a DTC Grid on an ASP or HTML page that has a data connection and a Recordset DTC.
 * 2) Open the Custom property pages for the Grid DTC and go to the Data tab.
 * 3) Select a recordset from the recordset drop-down list and select several fields from the Available fields list. Now select one of the items in the Grid columns list.
 * 4) In the Edit columns area, modify the text box labeled Header so that it has an apostrophe. For example, if the current value of the Header is "Name" you might enter "Name's".
 * 5) Apply the change using the Update, Apply, or OK button. Now view the page in a browser.

Keywords: kberrmsg kbbug kbctrl kbpending KB190940

-

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

© Microsoft Corporation. All rights reserved.