Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Option Explicit causing VBScript error

Reply
Thread Tools

Option Explicit causing VBScript error

 
 
John Kotuby
Guest
Posts: n/a
 
      03-23-2006
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...


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      03-23-2006
This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=

--
Patrice

"John Kotuby" <(E-Mail Removed)> a écrit dans le message de news:
http://www.velocityreviews.com/forums/(E-Mail Removed)...
> 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...
>



 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      03-23-2006
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" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=
>
> --
> Patrice
>
> "John Kotuby" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed)...
>> 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...
>>

>
>



 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      03-23-2006

"John Kotuby" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.



 
Reply With Quote
 
John Kotuby
Guest
Posts: n/a
 
      03-23-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "John Kotuby" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>
>
>



 
Reply With Quote
 
John Kotuby
Guest
Posts: n/a
 
      03-23-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed)...
>> This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=
>>
>> --
>> Patrice
>>
>> "John Kotuby" <(E-Mail Removed)> a écrit dans le message de news:
>> (E-Mail Removed)...
>>> 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...
>>>

>>
>>

>
>



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      03-24-2006
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" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> a écrit dans le message de news:
>> (E-Mail Removed)...
>>> This is <SCRIPT LANGUAGE=... not <SCRIPT> LANGUAGE=
>>>
>>> --
>>> Patrice
>>>
>>> "John Kotuby" <(E-Mail Removed)> a écrit dans le message de news:
>>> (E-Mail Removed)...
>>>> 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...
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation error '800a0400' option explicit S N ASP General 0 04-06-2008 09:25 PM
Explicit instantiation of STL vector demands explicit instantiation of all the templates it using internally. krunalbauskar@gmail.com C++ 1 12-25-2006 03:51 PM
What's the difference betwwen explicit instantiaion and explicit specialization? Andy C++ 5 01-30-2005 11:46 PM
Error with option explicit Robert Mark Bram ASP General 1 08-15-2004 02:16 PM
Is explicit template qualification required for explicit delete? J.T. Conklin C++ 1 08-11-2004 02:06 AM



Advertisments