This error is encountered quite often by VB programmers venturing into VBScript. In VB, you can say this:
Dim i As Integer For i = 1 to 10 Debug.Print i Next i |
In VBScript in an ASP page, on the other hand, both the Dim line and the Next line will cause the following error:
Microsoft VBScript compilation error '800a0401' Expected end of statement /<file>.asp, line <line> |
To correct:
Make sure you only Dim variables in ASP, without using AS. VBScript only supports variants, so there is no need to support explicit typecasting.
Make sure you just use 'Next' instead of 'Next i'... VBScript does not need to keep track of the control variable (though my preference would be for it to just ignore such a statement, so that VB and VBScript would be that much more syntactically consistent).
Make sure you don't create a string like this:
This will cause the error as well, since there are too many quotes.
Make sure you don't mix JavaScript syntax into a VBScript page, e.g.:
<script language=vbscript runat=server> var x = "1" </script> |
(In newer versions of ASP, this actually produces a '0x800A000D Type Mismatch' error.)
Basically, look at the line of code the ASP error points to, and try to figure out if there's any syntax on that line that you copied from another environment (e.g. VB), from another machine with possibly a newer version of ASP, or from memory. Chances are, you copied or wrote code that won't work in your environment, or has a syntax error of some kind.