473,396 Members | 1,784 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,396 software developers and data experts.

Option Explicit causing VBScript error

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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is correct.
Is it the placement?

Thanks...
Mar 23 '06 #1
6 8952
This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=

--
Patrice

"John Kotuby" <jo***@powerlist.com> a écrit dans le message de news:
uz**************@TK2MSFTNGP10.phx.gbl...
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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is
correct. Is it the placement?

Thanks...

Mar 23 '06 #2
Just to be on the safe side, you may want to tell us what you are trying to
do. This should be now syntactically correct but this is just an empty
server side block.
Perhaps you confused with <%@ Language=VBScript %> ?
--

"Patrice" <a@bc.c> a écrit dans le message de news:
ep**************@TK2MSFTNGP09.phx.gbl...
This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=

--
Patrice

"John Kotuby" <jo***@powerlist.com> a écrit dans le message de news:
uz**************@TK2MSFTNGP10.phx.gbl...
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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is
correct. Is it the placement?

Thanks...


Mar 23 '06 #3

"John Kotuby" <jo***@powerlist.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is correct. Is it the placement?

Thanks...


Yes Option Explict should be the first line of script and above any content
that is sent to the client.

In your case you have an include file preceeding it which likely contains
script.

Use:-

<% Option Explicit %>
<!-- #INCLUDE FILE="adovbs.inc" -->

Anthony.

Mar 23 '06 #4
Thank you Anthony,

You are indeed correct and how silly of me. Of course the "adovbs.inc" file
includes script.
Placing <% Option Explicit %> at the top fixed the problem.

"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...

"John Kotuby" <jo***@powerlist.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is

correct.
Is it the placement?

Thanks...


Yes Option Explict should be the first line of script and above any
content
that is sent to the client.

In your case you have an include file preceeding it which likely contains
script.

Use:-

<% Option Explicit %>
<!-- #INCLUDE FILE="adovbs.inc" -->

Anthony.

Mar 23 '06 #5
Thanks Patrice,

For noticing my Syntax error in the LANGUAGE declaration. Actually the code
never even got to that line because it bombed out on the <% Option Explicit
%> which I had placed after the:
<!-- #INCLUDE FILE="adovbs.inc" -->
Which itself contained script.

Now that I have fixed both errors the code is running.

Thanks again.

"Patrice" <a@bc.c> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl...
Just to be on the safe side, you may want to tell us what you are trying
to do. This should be now syntactically correct but this is just an empty
server side block.
Perhaps you confused with <%@ Language=VBScript %> ?
--

"Patrice" <a@bc.c> a écrit dans le message de news:
ep**************@TK2MSFTNGP09.phx.gbl...
This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=

--
Patrice

"John Kotuby" <jo***@powerlist.com> a écrit dans le message de news:
uz**************@TK2MSFTNGP10.phx.gbl...
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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is
correct. Is it the placement?

Thanks...



Mar 23 '06 #6
Sorry for the poor help, I shouldn't have stopped at the first thing I saw.

A possible approach could be :
- create an include file such as page.asp that contains both the Option
explicit and includes all the present and future files you'll need on each
page such as adovbs.inc (another option would be to use the type library by
declaring it in global.asa).

This way :
- you just have to include this general file and you can start with your
begin script tag.
- if later you need a general function on most of your page you'll be able
to include this file in your general include file and all pages you have
written will be right now ready to use the new function

--
Patrice

"John Kotuby" <jo***@powerlist.com> a écrit dans le message de news:
uC**************@TK2MSFTNGP11.phx.gbl...
Thanks Patrice,

For noticing my Syntax error in the LANGUAGE declaration. Actually the
code never even got to that line because it bombed out on the <% Option
Explicit %> which I had placed after the:
<!-- #INCLUDE FILE="adovbs.inc" -->
Which itself contained script.

Now that I have fixed both errors the code is running.

Thanks again.

"Patrice" <a@bc.c> wrote in message
news:Ou**************@TK2MSFTNGP14.phx.gbl...
Just to be on the safe side, you may want to tell us what you are trying
to do. This should be now syntactically correct but this is just an empty
server side block.
Perhaps you confused with <%@ Language=VBScript %> ?
--

"Patrice" <a@bc.c> a écrit dans le message de news:
ep**************@TK2MSFTNGP09.phx.gbl...
This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=

--
Patrice

"John Kotuby" <jo***@powerlist.com> a écrit dans le message de news:
uz**************@TK2MSFTNGP10.phx.gbl...
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
<!-- #INCLUDE FILE="adovbs.inc" -->
<% Option Explicit %>
<SCRIPT> LANGUAGE="VBScript" RUNAT="Server" </SCRIPT>
<% .... other code
%>

What am I doing wrong? According to a book on ASP 3.0 the syntax is
correct. Is it the placement?

Thanks...



Mar 24 '06 #7

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

Similar topics

1
by: Sundar | last post by:
Have you encountered "OPTION EXPLICIT" not working in a ASP program? - Windows 2000 Server - IIS 5.0 - Active Server Pages (VBScript) We had a program that had "OPTION EXPLICIT" in the first...
8
by: biro man | last post by:
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...
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: Agoston Bejo | last post by:
I am generating WML pages from ASP. I have header.inc that looks like this: ---------------------------------------------- <%@Language=VBScript%><% Option Explicit Response.Buffer = True...
3
by: s_m_b | last post by:
Anyone ever seen this before? A page that generates a calendar view, works just fine without 'option explicit' . Add this in, but have missed some dim statements out in error, so page should...
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.