Microsoft VBScript compilation (0x800A0400) Expected statement |
This is usually due to using a With statement on a server with an older version of the script engines. Make sure you have the most recent script engines on your server; specifically, With requires version 5.0. See
Article #2151 for information about getting the most recent updates.
Microsoft VBScript compilation (0x800A0401) Expected end of statement |
This is usually due to embedding double quotes inside a string, e.g.
| strMyName = "foo "bar" jones" |
To fix, either double-up the quotes, or use single quotes (see
Article #2065 for more information):
strMyName = "foo ""bar"" jones" or strMyName = "foo 'bar' jones" |
Microsoft VBScript compilation (0x800A0402) Expected integer constant |
This is due to attempting to use a variable to declare the bounds of an array. For more information, see
Article #2067.
Microsoft JScript compilation (0x800A0406) Conditional compilation is turned off |
This is caused by using a variable name that starts with an @ symbol. This is not a problem in VBScript, as it does not try to interpret the @ symbol as a conditional statement. Here is an example that reproduces the problem:
<Script language=javascript runat=server> Response.Write(@foo); </script> |
However we have been unable to find any documentation on enabling conditional compilation. :-(
Microsoft VBScript compilation (0x800A0408) Invalid character |
This is fairly easy to reproduce:
<% Response.Write("foo"$) %> |
Obviously, that dollar sign doesn't belong there. See
Article #2376 for a more detailed description of this error message, and other possible causes.
Microsoft VBScript compilation (0x800A0409) Unterminated string constant |
This is usually caused by missing end quotes, for example:
| strMyName = "foo 'bar' jones |
Microsoft VBScript compilation (0x800A040D) Invalid use of 'Me' keyword |
'me' is a special word. See how the following script fails:
<% set you = nothing set me = nothing %> |
Try to avoid using 'me' for class and object names.
Microsoft VBScript compilation (0x800A040E) 'loop' without 'do' |
This is often due to leaving out a do while not rs.eof, or finishing a for or while struct with a loop. It can also be caused by improper nesting, e.g.
<% i = 1 do while i < 10 if i = 5 then loop end if %> |
Microsoft VBScript compilation (0x800A040F) Invalid 'exit' statement |
You probably did something like this:
<% for i = 1 to 10 ' some logic exit do next or do while i < 10 ' some logic exit for loop %> |
Obviously, the fix is to exit the right type of struct:
<% for i = 1 to 10 ' some logic exit for next or do while i < 10 ' some logic exit do loop %> |
If you are using a while...wend struct, you might notice that this doesn't work:
<% while i < 10 ' some logic exit while wend %> |
Consider using a do while...loop struct instead (which is preferred anyway), or taking a different approach:
<% while i < 10 ' some logic i = 10 wend %> |
Setting i to 10 will kick you right out of the while...wend.
Microsoft VBScript compilation (0x800A0410) Invalid 'for' loop control variable |
This can happen if you use the same variable name in a nested loop, e.g.
<% for i = 1 to 5 for i = 1 to 10 ' do something next next %> |
Microsoft VBScript compilation (0x800A0411) Name redefined |
This means you defined (using the dim keyword) a variable or array twice. This could be from including the same file twice, or simply having two different dim statements for the same variable name. You will have to search the file for the previous occurence, as the error message will point at the later line.
Microsoft VBScript compilation (0x800A0412) Must be first statement on the line |
This can happen when you use the following statement:
<% If SomeCondition Then DoSomething End If %> |
An if/end structure should look like this:
<% If SomeCondition Then DoSomething End if %> |
Which is easier to read than the correct version of shorthand, putting it all on one line:
<% If SomeCondition Then DoSomething %> |
Notice that when you put the entire conditional on one line, the End if no longer belongs.
Microsoft VBScript compilation (0x800A0414) Cannot use parentheses when calling a Sub |
For information about this error, see
Article #2115.
Microsoft VBScript compilation (0x800A0415) Expected literal constant |
You tried to assign a variable to a CONST statement. For example:
<% CONST varName = someOtherVarName %> |
CONST should be used to declare literal strings or numeric values.
<% CONST strVarName = "foo" CONST intVarName = 4 %> |
If you are re-assigning a variable's value to another value, use a regular variable instead of a CONST declaration.
Microsoft VBScript compilation error '800a0418' Must be defined inside a Class |
Like the error states, you can't have statements like this in an ASP page:
<% Public Property Let PropertyName %> |
And if your class has a Property Get statement, you might get this error:
Microsoft VBScript compilation error '800a041b' Number of arguments must be consistent across properties specification |
Which usually means your property assignments don't match.
Microsoft VBScript runtime error '800a041d' Class initialize or terminate do not have arguments |
This error message is self-explanatory; your class is not constructed properly.
Microsoft VBScript compilation error '800a041f' Unexpected 'Next' |
This is usually caused by incorrect nesting of do and/or for/next loops. An example:
<% for i = 0 to 1 do while i < 2 next loop %> |