473,574 Members | 2,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12228
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.super news.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******** ******@tk2msftn gp13.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.super news.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******** ********@TK2MSF TNGP10.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******** ******@tk2msftn gp13.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.super news.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.super news.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******** ********@TK2MSF TNGP10.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******** ******@tk2msftn gp13.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.super news.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"in g doesn't also have <%option explicit
%> set.
"biro man" <al************ @hotmail.com> wrote in message
news:vs******** ****@corp.super news.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="VBScr ipt" %>
<% Option Explicit %>
<!--#include file="somefile. asp"-->
<!--#include file="../some/otherfile.asp"-->
<!--#include virtual="/asp/anotherfile.asp "-->

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

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

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

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

What you get when you load default.asp
<%@ LANGUAGE="VBScr ipt" %>
<% 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="VBScr ipt" %>
<% 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*****@hotmai l.com> wrote in message
news:Od******** ******@tk2msftn gp13.phx.gbl...
make sure the file you are "include"in g doesn't also have <%option explicit %> set.
"biro man" <al************ @hotmail.com> wrote in message
news:vs******** ****@corp.super news.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******** ******@TK2MSFTN GP10.phx.gbl...
--- in default.asp ---
<%@ LANGUAGE="VBScr ipt" %>
<% Option Explicit %>
<!--#include file="somefile. asp"-->
<!--#include file="../some/otherfile.asp"-->
<!--#include virtual="/asp/anotherfile.asp "-->

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

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

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

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

What you get when you load default.asp
<%@ LANGUAGE="VBScr ipt" %>
<% 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="VBScr ipt" %>
<% 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*****@hotmai l.com> wrote in message
news:Od******** ******@tk2msftn gp13.phx.gbl...
make sure the file you are "include"in g doesn't also have <%option

explicit
%> set.
"biro man" <al************ @hotmail.com> wrote in message
news:vs******** ****@corp.super news.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*****@hotmai l.com> wrote in message
news:eH******** ******@tk2msftn gp13.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
2511
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" runat=server src="lib/upload/aspUpload.asp">
5
1454
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 can't BOTH be first can they? OK - I give up. How do you do it?
7
3381
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. This does not happen, but undeclare variables lead to some odd results. Error somewhere or has IIS changfed its behavior? "Testbed" Win XP Pro SP2
5
2941
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
2025
by: ken | last post by:
hi All What does this command dot Option Explicit
9
2315
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 problems have cropped up. Most are easy to solve with using an explicit type cast cType(whatever, whatever type), but some aren't. Situation 1: I've...
6
8988
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 statement /transferkey.asp, line 2
4
5355
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 object identity." error on the 'Case "Main"' statement in the below code; Select Case Row("Contact_Type") Case "Main" .....
1
2134
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 occur if the charset declaration in the metatag is 8859-1 but this causes spurious characters such as capital A with a circle over it to appear before...
0
7801
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7719
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6450
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1055
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.