Microsoft Vbscript Compilation Error 800a0400 Option Explicit
Contents |
of my ASP page... Microsoft VBScript compilation error '800a0400' Expected statement /mailform.asp, line 1 Option Explicit ^ Would microsoft vbscript compilation error '800a0400' expected statement anyone know why that is? westmich 2001-04-11 05:43:05 UTC #2 vbscript compilation error expected end of statement Are there any variables you are not initializing? SeFu 2001-04-11 08:16:45 UTC #3 hmm...not sure. i 1 1 microsoft vbscript compilation error expected statement suppose there could be heh is that the error I would get if that were the case?seems like an off the wall sort of error response Im 800a0400 expected_statement 80 sure that must be the problem though shane 2001-04-11 20:23:04 UTC #4 If you had an undeclared variable I'd normally expect an 'Undefined variable' error. Have you got any script before the Option Explicit statement? Remember, that if you ssi any files in the page that contain script then these include statements also
Expected Statement End If
have to come after the Option Explicit statement. One other thing, if you're using the script language directive this has to be contained within script delimiters even if more script follows straight after. eg:<%@ Language = "VBScript" %><% Option Explicit'Rest of script .... SeFu 2001-04-12 03:00:48 UTC #5 yea its weird... i make sure to put Option Explicit FIRST THING on my page (cause Im not declaring the scripting language). Another thing is... when I try and declare the scripting language... I get a 500 error i dunno... weird stuff... and my books dont cover these things goober 2001-04-14 19:08:00 UTC #6 You should declare the scripting language as VBScript first, then use Option Explicit. Also, make SURE those are the first two lines in any ASP page. Hope this helps. Mittineague 2014-10-03 08:02:57 UTC #7 Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled Shop Versioning Reference Articles Premium
- Expected Statement Perhaps instead of 'Expected Statement', 'missing character' would be a better error message. I have noticed with error 800A0400 how often the problem
Vbscript Goto
is at the beginning or the end of the line mentioned in vbscript tutorial the error message. Introduction to Code 800A0400 Error code 800A0400 is a generic message when you execute a VBScript. A wild guess, you have missed a command at the beginning of a line. The Symptoms You Get The script does not execute as you had hoped. Instead you https://www.sitepoint.com/community/t/asp-error-using-option-explicit-huh/1036 get a message box like this picture: The Cause of Error 800A0400 Your VBScript contain is missing a statement. This is a difficult error to track down. However, the good news is that I have three examples. Most likely you have placed a statement, which is not appropriate for the logic of your script. For example, extra brackets, or missing command. http://www.computerperformance.co.uk/Logon/code/code_800A0400.htm Note: the clue 'Source: Microsoft VBScript compilation error'. My point is that 'compilation error' and not a 'runtime error', means this is a syntax error in your script. The Solution for Error: Expected statement The Windows Scripting Host gives us two useful clues, firstly, look on Line: 10, do count any remark or empty lines. Secondly, the Char: number 1, is useful in tracing the error. In this case there is something wrong with the Select statement. The line number, as is so often the case, is crucial to solving this error. The problem is that the whole line is gibberish to the VBScript engine. So take another look at each word, punctuation and see if you can spot a simple error. ‡ Example 1 of Error code: 800A0400Missing underscore at the end of the line 7: ' WSHname.vbs' Sample VBScript to check WSH Version' Author Guy Thomas http://computerperformance.co.uk/' Version 2.3 - September 2010 ' -------------------------------------------------------On Error Resume Next WScript.Echo "WSH Version: " & WScript.Version & " " & WScript.BuildVersion & vbcr & "File name: " WScript.ScriptName WScr
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for https://www.experts-exchange.com/questions/28175324/Option-Explicit-issue.html a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions http://forums.whirlpool.net.au/archive/976000 > Option Explicit issue Want to Advertise Here? Solved Option Explicit issue Posted on 2013-07-03 VB Script ASP 1 Verified Solution 7 Comments 501 Views Last Modified: 2013-07-03 Hello experts, I'm having vbscript compilation a strange issue with Option Explicit: if I put it at the top of the page and before various include files as I should, it's not breaking properly on undefined variables. If I put it after the include files, it does break on undefined variables. I've checked the files that get included and none of them are setting Option Explicit Off. What else might be vbscript compilation error causing Option Explicit to be turned off between the top of the page and the actual code? Example: <% Option Explicit %> <% response.write "here's an undefined variable: "&badvariable%> What happens here is that it doesn't break; it just skips the line that is supposed to print the variable. Thanks! 0 Question by:EffinGood Facebook Twitter LinkedIn Google LVL 52 Active today Best Solution byScott Fell, EE MVE The include files are rendered just as if the code was on the page. Therefor, adding option explicit before or after your include files and having it not working or not means something is on the code Go to Solution 7 Comments LVL 82 Overall: Level 82 ASP 13 VB Script 5 Message Active today Expert Comment by:Dave Baldwin2013-07-03 Should be... <% Option Explicit On %> More info: http://msdn.microsoft.com/en-us/library/y9341s4f%28v=vs.80%29.aspx 0 Message Author Comment by:EffinGood2013-07-03 First, according to the link you sent, the On is optional, so that shouldn't affect it; second, when I do that I get the following error: Microsoft VBScript compilation error '800a03ea' Syntax error myfile.asp, line 1 Option Explicit On