Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 3rd, 2004, 02:58 AM
Registered User
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #2 (permalink)  
Old June 3rd, 2004, 03:17 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #3 (permalink)  
Old June 3rd, 2004, 10:20 PM
Registered User
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar, it works.

Regards
Tom
Reply With Quote
  #4 (permalink)  
Old January 2nd, 2006, 07:53 PM
Registered User
 
Join Date: Jan 2006
Location: , , .
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 %>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:22 AM.


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