469,303 Members | 1,900 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

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 12047
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Robert Mark Bram | last post: by
7 posts views Thread by Mats | last post: by
9 posts views Thread by YYZ | last post: by
4 posts views Thread by John | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.