Business Opportunities

Search
Directory
Links

Search

Create the future you want! Learn to make money online. Visit our website and start today!  www.exclusivebizopps.com

Why do I get 800A0401 errors?

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: 
 
myString = ""stuff"
 
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.

[ Comment, Edit or Article Submission ]

Share this:

Add To Del.icio.us Add To Reddit Add To Yahoo MyWeb Add To Google Bookmarks Add To Furl Fav This With Technorati Add To Newsvine Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This Digg This

More about:

Dec January 2009 Feb
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Related Blog of Business Opportunities on Sphere Business Opportunities Blog on Technorati

Business Opportunities

Copyright © 2008 www.exclusivebizopps.co.uk. All rights reserved.
Valid XHTML 1.0 Transitional

For Sale by Owner No Commission Real Estate Listin