473,668 Members | 2,392 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 12233
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
2513
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
1460
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
3386
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
2944
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
2027
by: ken | last post by:
hi All What does this command dot Option Explicit
9
2326
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 got code that tries to get the itemkey of the selected item in a combobox....
6
8999
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
5357
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
2139
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 the "£" symbol when newsfeeds are paced on the 8859-1 page. Not very professional! These was a...
0
8459
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8378
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8577
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2786
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.