Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 3rd, 2004, 02:58 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBScript compilation (0x800A0400) Expected stateme

Hi all,

I use "option explicit" in asp and get complilation error when loading it. If I comment it out it run ok?

I run it on windows xp, win 2k - iis.

the error message: Microsoft VBSCript compilation (0x800A0400) Expected statement.

Any advice is appreciated.
the code:
------------------
<% Language=VBScript %>
<% Option Explicit %>

<html>
<body>
<%
    If DatePart("h", Time()) >= 12 then
        ' It is after noon
        Response.Write "Good Evening!"
    Else
        Response.Write "Good Morning"
    End If


%>

</body>

</html>

-----------

regards

Tom
 
Old June 3rd, 2004, 03:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Tom,

The error is caused by an incorrect page directive. Instead of <% language you'll need <%@ language. So this will work
Code:
:<%@ Language=VBScript %>
<% Option Explicit %>

<html>
<body>
<%
    If DatePart("h", Time()) >= 12 then
        ' It is after noon
        Response.Write "Good Evening!"
    Else
        Response.Write "Good Morning"
    End If


%>
Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 3rd, 2004, 10:20 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar, it works.

Regards
Tom
 
Old January 2nd, 2006, 07:53 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

is there any way i can get some help i got kinda the same problem i've removed the code and the page works fine but i need the code

Microsoft VBScript compilation (0x800A0400)
Expected statement
/talk/index.asp, line 60
End If

57><%
58>If Request.QueryString("msg") = "3754658" Then Response.Write("<b>Your account Has been deleted !</b>")
59>If Request.QueryString("msg") = "5748768134" Then Response.Write("<b>Your session has timed out please login again</b>")
60>End If
61>If Request.QueryString("mes") = "541236987" Then Response.Write("<b>Your session has timed out please login again</b>")
62>End If %>





Similar Threads
Thread Thread Starter Forum Replies Last Post
'expected then' VB script compilation error Adam H-W Classic ASP Basics 9 July 19th, 2009 11:02 AM
Microsoft VBScript compilation (0x800A0400) pendemv Classic ASP Databases 1 September 1st, 2008 02:58 PM
Microsoft VBScript compilation (0x800A0400) joeyjoejnr Classic ASP Databases 2 May 9th, 2007 03:22 AM
Microsoft VBScript compilation (0x800A0400) davidclangley ASP.NET 2.0 Basics 0 February 11th, 2007 10:46 AM
Microsoft VBScript compilation (0x800A0400) cnottingham Classic ASP Databases 2 February 12th, 2004 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.