473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

option explicit error

I have a dynamic database driven page that I have been working on and
tweaking etc until I have got it to work pretty much the way I want it to.

I also have a defined website. I wish to include the new dbase page in the
exisiting website and keep the "feel" of the exisiting website.

So I thought the easiest way to do this wasy to use the template that I had
created for the existing site and then just *include* the .asp pages.

However..when I tried this i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit
default.asp is the name of the asp page that I have newly created and works
fine as a standalone page.

when I put it into the template page, I get the error...

incidently line 1 in default.asp is <% option explicit %>

any ideas? or even better if you point me in the direction of some pages
that might explain it.

many thanks
Jul 19 '05 #1
8 12215
Option Explicit has to be any other code.

Valid:
Option Explicit
Response.Write "hey"

Invalid:
Response.Write "hey"
Option Explicit

Do you have an include above this line?

Ray at work

"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit

Jul 19 '05 #2
That was supposed to say:
Option Explicit has to be BEFORE any other code.

Oops.

Ray at work

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Option Explicit has to be any other code.

Valid:
Option Explicit
Response.Write "hey"

Invalid:
Response.Write "hey"
Option Explicit

Do you have an include above this line?

Ray at work

"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit


Jul 19 '05 #3
I've already tried that one

I have Nothing above that line..

I made it the first line in the default.asp page..then tried the first line
in the template page.....still the same error...think I might have to just
start again,..bloody annoying...been tweaking this page all day and now
gonna have to do it again.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
That was supposed to say:
Option Explicit has to be BEFORE any other code.

Oops.

Ray at work

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Option Explicit has to be any other code.

Valid:
Option Explicit
Response.Write "hey"

Invalid:
Response.Write "hey"
Option Explicit

Do you have an include above this line?

Ray at work

"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit



Jul 19 '05 #4
Is this file being included by another file? Do you have vbscript set as
your default language in IIS or are you declaring a language? Are you
saying that a file, with only these contents, and loaded directly in the
browser by itself, would cause this error?

<% Option Explicit %>

Ray at work
"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
I've already tried that one

I have Nothing above that line..

I made it the first line in the default.asp page..then tried the first line in the template page.....still the same error...think I might have to just
start again,..bloody annoying...been tweaking this page all day and now
gonna have to do it again.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
That was supposed to say:
Option Explicit has to be BEFORE any other code.

Oops.

Ray at work

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl...
Option Explicit has to be any other code.

Valid:
Option Explicit
Response.Write "hey"

Invalid:
Response.Write "hey"
Option Explicit

Do you have an include above this line?

Ray at work

"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
> i get the following error
>
> Microsoft VBScript compilation (0x800A0400)
> Expected statement
> /sitename/ripe45/default.asp, line 1
> Option Explicit
>
>



Jul 19 '05 #5
make sure the file you are "include"ing doesn't also have <%option explicit
%> set.
"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
I have a dynamic database driven page that I have been working on and
tweaking etc until I have got it to work pretty much the way I want it to.

I also have a defined website. I wish to include the new dbase page in the
exisiting website and keep the "feel" of the exisiting website.

So I thought the easiest way to do this wasy to use the template that I had created for the existing site and then just *include* the .asp pages.

However..when I tried this i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit
default.asp is the name of the asp page that I have newly created and works fine as a standalone page.

when I put it into the template page, I get the error...

incidently line 1 in default.asp is <% option explicit %>

any ideas? or even better if you point me in the direction of some pages
that might explain it.

many thanks

Jul 19 '05 #6
--- in default.asp ---
<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<!--#include file="somefile.asp"-->
<!--#include file="../some/otherfile.asp"-->
<!--#include virtual="/asp/anotherfile.asp"-->

--- in somefile.asp ---
<!--#include file="thisfile.asp"-->
<%@ LANGUAGE="VBScript" %>
<%
'asp code for somefile.asp goes here
%>

--- in thisfile.asp ---
<%@ LANGUAGE="VBScript" %>
<%
'asp code for thisfile.asp goes here
%>

--- in ../some/otherfile.asp ---
<%@ LANGUAGE="VBScript" %>
<%
'asp code for otherfile.asp goes here
%>

--- in /asp/anotherfile.asp ---
<%@ LANGUAGE="VBScript" %>
<%
'asp code for anotherfile.asp goes here
%>

What you get when you load default.asp
<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<% 'asp code for thisfile.asp %>
<% 'asp code for somefile.asp %>
<% 'asp code for ../some/otherfile.asp %>
<% 'asp code for /asp/anotherfile.asp %>
<%
' rest of asp code in default.asp
%>

Any loaded pages should have the language directive and then option explicit
then include files and/or additional code. Any included files should NOT
have option explicit. Also, include directives can be anywhere in your
document but not between <% %> tags.

I have in my files:

default.asp
<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<!--#include virtual="/asp/header.asp"-->
<%
' additional code
%>
<!--#include virtual="/asp/footer.asp"-->
--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

"TomB" <sh*****@hotmail.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
make sure the file you are "include"ing doesn't also have <%option explicit %> set.
"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
I have a dynamic database driven page that I have been working on and
tweaking etc until I have got it to work pretty much the way I want it to.
I also have a defined website. I wish to include the new dbase page in the exisiting website and keep the "feel" of the exisiting website.

So I thought the easiest way to do this wasy to use the template that I

had
created for the existing site and then just *include* the .asp pages.

However..when I tried this i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit
default.asp is the name of the asp page that I have newly created and

works
fine as a standalone page.

when I put it into the template page, I get the error...

incidently line 1 in default.asp is <% option explicit %>

any ideas? or even better if you point me in the direction of some pages
that might explain it.

many thanks


Jul 19 '05 #7
Uh, yeah. That's what I was getting at.

"Roland Hall" <nobody@nowhere> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
--- in default.asp ---
<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<!--#include file="somefile.asp"-->
<!--#include file="../some/otherfile.asp"-->
<!--#include virtual="/asp/anotherfile.asp"-->

--- in somefile.asp ---
<!--#include file="thisfile.asp"-->
<%@ LANGUAGE="VBScript" %>
<%
'asp code for somefile.asp goes here
%>

--- in thisfile.asp ---
<%@ LANGUAGE="VBScript" %>
<%
'asp code for thisfile.asp goes here
%>

--- in ../some/otherfile.asp ---
<%@ LANGUAGE="VBScript" %>
<%
'asp code for otherfile.asp goes here
%>

--- in /asp/anotherfile.asp ---
<%@ LANGUAGE="VBScript" %>
<%
'asp code for anotherfile.asp goes here
%>

What you get when you load default.asp
<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<% 'asp code for thisfile.asp %>
<% 'asp code for somefile.asp %>
<% 'asp code for ../some/otherfile.asp %>
<% 'asp code for /asp/anotherfile.asp %>
<%
' rest of asp code in default.asp
%>

Any loaded pages should have the language directive and then option explicit then include files and/or additional code. Any included files should NOT
have option explicit. Also, include directives can be anywhere in your
document but not between <% %> tags.

I have in my files:

default.asp
<%@ LANGUAGE="VBScript" %>
<% Option Explicit %>
<!--#include virtual="/asp/header.asp"-->
<%
' additional code
%>
<!--#include virtual="/asp/footer.asp"-->
--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

"TomB" <sh*****@hotmail.com> wrote in message
news:Od**************@tk2msftngp13.phx.gbl...
make sure the file you are "include"ing doesn't also have <%option

explicit
%> set.
"biro man" <al************@hotmail.com> wrote in message
news:vs************@corp.supernews.com...
I have a dynamic database driven page that I have been working on and
tweaking etc until I have got it to work pretty much the way I want it to.
I also have a defined website. I wish to include the new dbase page in the exisiting website and keep the "feel" of the exisiting website.

So I thought the easiest way to do this wasy to use the template that I
had
created for the existing site and then just *include* the .asp pages.

However..when I tried this i get the following error

Microsoft VBScript compilation (0x800A0400)
Expected statement
/sitename/ripe45/default.asp, line 1
Option Explicit
default.asp is the name of the asp page that I have newly created and

works
fine as a standalone page.

when I put it into the template page, I get the error...

incidently line 1 in default.asp is <% option explicit %>

any ideas? or even better if you point me in the direction of some

pages that might explain it.

many thanks



Jul 19 '05 #8

"TomB" <sh*****@hotmail.com> wrote in message
news:eH**************@tk2msftngp13.phx.gbl...
Uh, yeah. That's what I was getting at.


My post wasn't directed at you Tom, just providing a visual for biro man.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Mark Bram | last post by:
Hi All! I have the following in a vb script: option explicit Response.Expires = -1 Server.ScriptTimeout = 600 The script gets imported in the following way: <script language="VBscript"...
5
by: Captain Nemo | last post by:
If you look around on the web for advice on cache-control and using 'Option Explicit' you get a paradox. Both features are supposed to be the first piece of ASP code on the page. Well they...
7
by: Mats | last post by:
Option Explicit does not work anymore.(?) If you put <%option explicit%> at the top of your pages (direktly after the language declaration) you should get an error for each undeclared variable....
5
by: John | last post by:
Hi I am getting conversion errors in the below code on the lines highlighted in red. Would appreciate any tips on how to fix these errors. Thanks Regards
5
by: ken | last post by:
hi All What does this command dot Option Explicit
9
by: YYZ | last post by:
After reading many messages in this group, it seems that the preferred setting for this is ON. Okay, I did that in my project (first with ..Net -- long time VB6 developer) and now a bunch of...
6
by: John Kotuby | last post by:
Hi all, I am simply trying to include the Option Explicit declaration at the top of an ASP page and am getting an error: Error Type: Microsoft VBScript compilation (0x800A0400) Expected...
4
by: John | last post by:
Hi I have a vs 2003 project which I have just imported into vs 2005. Now I am getting the "Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for...
1
by: Jimmbo | last post by:
I get an option explicit error saying it does not appear as the first line whenever I use it with utf-8 charset encoding on my Sun Cobalt server running Chillisoft on Linux. The error does not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.