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

Select Case Syntax Error

Hi, I am getting a syntax error
Microsoft VBScript compilation error '800a03ea'

Syntax error

On the code below. The error references the "End Select" line

Can anyone help me with what I am doing wrong?

Thanks

-========================================

<%
SELECT CASE iChoice

Dim iChoice

iChoice = varVendor

Select Case iChoice
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"
Case "Alexander"
Response.Write "<!--#include virtual='/western/services/owdbAlex.asp'-->"
Case "Classical"
Response.Write "<!--#include
virtual='/western/services/owdbClassical.asp'-->"
Case "CQPress"
Response.Write "<!--#include
virtual='/western/services/owdbCQPress.asp'-->"
Case "FactsOnFile"
Response.Write "<!--#include virtual='/western/services/owdbFOF.asp'-->"
Case "Greenwood"
Response.Write "<!--#include virtual='/western/services/owdbGreen.asp'-->"
Case "Grove"
Response.Write "<!--#include virtual='/western/services/owdbGrove.asp'-->"
Case "Lexis-Nexis"
Response.Write "<!--#include virtual='/western/services/owdbLexis.asp'-->"
Case "Morningstar"
Response.Write "<!--#include virtual='/western/services/owdbMStar.asp'-->"
Case "Oxford Press"
Response.Write "<!--#include
virtual='/western/services/owdbOxford.asp'-->"
Case "Vanderbilt"
Response.Write "<!--#include virtual='/western/services/owdbVandy.asp'-->"
Case "Westlaw"
Response.Write "<!--#include
virtual='/western/services/owdbWestlaw.asp'-->"
Case "Wiley"
Response.Write "<!--#include virtual='/western/services/owdbWiley.asp'-->"
Case Else
Response.Write "<h3>Please select a vendor. <br> <input type=button
value=Back onClick='history.back(1);'></h3>"

END SELECT

%>
Jul 19 '05 #1
9 3599
you have Select Case twice

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kevin" <thersitz @yahoo com> wrote in message
news:uP**************@TK2MSFTNGP15.phx.gbl...
Hi, I am getting a syntax error
Microsoft VBScript compilation error '800a03ea'

Syntax error

On the code below. The error references the "End Select" line

Can anyone help me with what I am doing wrong?

Thanks

-========================================

<%
SELECT CASE iChoice

Dim iChoice

iChoice = varVendor

Select Case iChoice
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"
Case "Alexander"
Response.Write "<!--#include virtual='/western/services/owdbAlex.asp'-->"
Case "Classical"
Response.Write "<!--#include
virtual='/western/services/owdbClassical.asp'-->"
Case "CQPress"
Response.Write "<!--#include
virtual='/western/services/owdbCQPress.asp'-->"
Case "FactsOnFile"
Response.Write "<!--#include virtual='/western/services/owdbFOF.asp'-->"
Case "Greenwood"
Response.Write "<!--#include
virtual='/western/services/owdbGreen.asp'-->"
Case "Grove"
Response.Write "<!--#include
virtual='/western/services/owdbGrove.asp'-->"
Case "Lexis-Nexis"
Response.Write "<!--#include
virtual='/western/services/owdbLexis.asp'-->"
Case "Morningstar"
Response.Write "<!--#include
virtual='/western/services/owdbMStar.asp'-->"
Case "Oxford Press"
Response.Write "<!--#include
virtual='/western/services/owdbOxford.asp'-->"
Case "Vanderbilt"
Response.Write "<!--#include
virtual='/western/services/owdbVandy.asp'-->"
Case "Westlaw"
Response.Write "<!--#include
virtual='/western/services/owdbWestlaw.asp'-->"
Case "Wiley"
Response.Write "<!--#include
virtual='/western/services/owdbWiley.asp'-->"
Case Else
Response.Write "<h3>Please select a vendor. <br> <input type=button
value=Back onClick='history.back(1);'></h3>"

END SELECT

%>

Jul 19 '05 #2
> Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"


You can't do this. Look at server.execute or see http://www.aspfaq.com/2042

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #3
Any reason you've got "Select Case iChoice" in there twice?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Kevin" <thersitz @yahoo com> wrote in message
news:uP**************@TK2MSFTNGP15.phx.gbl...
Hi, I am getting a syntax error
Microsoft VBScript compilation error '800a03ea'

Syntax error

On the code below. The error references the "End Select" line

Can anyone help me with what I am doing wrong?

Thanks

-========================================

<%
SELECT CASE iChoice

Dim iChoice

iChoice = varVendor

Select Case iChoice
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"
Case "Alexander"
Response.Write "<!--#include virtual='/western/services/owdbAlex.asp'-->" Case "Classical"
Response.Write "<!--#include
virtual='/western/services/owdbClassical.asp'-->"
Case "CQPress"
Response.Write "<!--#include
virtual='/western/services/owdbCQPress.asp'-->"
Case "FactsOnFile"
Response.Write "<!--#include virtual='/western/services/owdbFOF.asp'-->"
Case "Greenwood"
Response.Write "<!--#include virtual='/western/services/owdbGreen.asp'-->" Case "Grove"
Response.Write "<!--#include virtual='/western/services/owdbGrove.asp'-->" Case "Lexis-Nexis"
Response.Write "<!--#include virtual='/western/services/owdbLexis.asp'-->" Case "Morningstar"
Response.Write "<!--#include virtual='/western/services/owdbMStar.asp'-->" Case "Oxford Press"
Response.Write "<!--#include
virtual='/western/services/owdbOxford.asp'-->"
Case "Vanderbilt"
Response.Write "<!--#include virtual='/western/services/owdbVandy.asp'-->" Case "Westlaw"
Response.Write "<!--#include
virtual='/western/services/owdbWestlaw.asp'-->"
Case "Wiley"
Response.Write "<!--#include virtual='/western/services/owdbWiley.asp'-->" Case Else
Response.Write "<h3>Please select a vendor. <br> <input type=button
value=Back onClick='history.back(1);'></h3>"

END SELECT

%>

Jul 19 '05 #4
Thanks Aaron. My original working code was:

<%
If varVendor = "McGraw Hill" Then
%>
<!--#include virtual="/western/services/owdbMcGraw.asp"-->
<%
ElseIf varVendor = "Classical" Then
%>
<!--#include virtual="/western/services/owdbClassical.asp"-->
<%
ElseIf varVendor = "Lexis-Nexis" Then
%>
<!--#include virtual="/western/services/owdbLexis.asp"-->
<%
ElseIf varVendor = "Oxford Press" Then
%>
<!--#include virtual="/western/services/owdbOxford.asp"-->

and on and on -- etc.

But my string of If Then ElsIf statements is up to 15 and so I was trying to
do the select case to reduce the statements. Guess I am back to the If Then
....ElseIf

I am sure I read that faq way back when and that is how I came to my
original If Then syntax.

Thanks
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Ou*************@tk2msftngp13.phx.gbl...
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"
You can't do this. Look at server.execute or see

http://www.aspfaq.com/2042
--
http://www.aspfaq.com/
(Reverse address to reply.)

Jul 19 '05 #5
Thanks Curt. I made the correction and now it executes, but the result is
what Aaron was alluding to. So I guess I am returning to the If ... Then ...
Else code.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:e1**************@tk2msftngp13.phx.gbl...
you have Select Case twice

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kevin" <thersitz @yahoo com> wrote in message
news:uP**************@TK2MSFTNGP15.phx.gbl...
Hi, I am getting a syntax error
Microsoft VBScript compilation error '800a03ea'

Syntax error

On the code below. The error references the "End Select" line

Can anyone help me with what I am doing wrong?

Thanks

-========================================

<%
SELECT CASE iChoice

Dim iChoice

iChoice = varVendor

Select Case iChoice
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"
Case "Alexander"
Response.Write "<!--#include virtual='/western/services/owdbAlex.asp'-->" Case "Classical"
Response.Write "<!--#include
virtual='/western/services/owdbClassical.asp'-->"
Case "CQPress"
Response.Write "<!--#include
virtual='/western/services/owdbCQPress.asp'-->"
Case "FactsOnFile"
Response.Write "<!--#include virtual='/western/services/owdbFOF.asp'-->" Case "Greenwood"
Response.Write "<!--#include
virtual='/western/services/owdbGreen.asp'-->"
Case "Grove"
Response.Write "<!--#include
virtual='/western/services/owdbGrove.asp'-->"
Case "Lexis-Nexis"
Response.Write "<!--#include
virtual='/western/services/owdbLexis.asp'-->"
Case "Morningstar"
Response.Write "<!--#include
virtual='/western/services/owdbMStar.asp'-->"
Case "Oxford Press"
Response.Write "<!--#include
virtual='/western/services/owdbOxford.asp'-->"
Case "Vanderbilt"
Response.Write "<!--#include
virtual='/western/services/owdbVandy.asp'-->"
Case "Westlaw"
Response.Write "<!--#include
virtual='/western/services/owdbWestlaw.asp'-->"
Case "Wiley"
Response.Write "<!--#include
virtual='/western/services/owdbWiley.asp'-->"
Case Else
Response.Write "<h3>Please select a vendor. <br> <input type=button
value=Back onClick='history.back(1);'></h3>"

END SELECT

%>


Jul 19 '05 #6
yeah, operator error. Curt busted me on that as well. Still a little fuzzy
on Select Case. Thanks for your time.

Kevin

"Steven Burn" <pv*@noyb.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Any reason you've got "Select Case iChoice" in there twice?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Kevin" <thersitz @yahoo com> wrote in message
news:uP**************@TK2MSFTNGP15.phx.gbl...
Hi, I am getting a syntax error
Microsoft VBScript compilation error '800a03ea'

Syntax error

On the code below. The error references the "End Select" line

Can anyone help me with what I am doing wrong?

Thanks

-========================================

<%
SELECT CASE iChoice

Dim iChoice

iChoice = varVendor

Select Case iChoice
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"
Case "Alexander"
Response.Write "<!--#include

virtual='/western/services/owdbAlex.asp'-->"
Case "Classical"
Response.Write "<!--#include
virtual='/western/services/owdbClassical.asp'-->"
Case "CQPress"
Response.Write "<!--#include
virtual='/western/services/owdbCQPress.asp'-->"
Case "FactsOnFile"
Response.Write "<!--#include virtual='/western/services/owdbFOF.asp'-->" Case "Greenwood"
Response.Write "<!--#include

virtual='/western/services/owdbGreen.asp'-->"
Case "Grove"
Response.Write "<!--#include

virtual='/western/services/owdbGrove.asp'-->"
Case "Lexis-Nexis"
Response.Write "<!--#include

virtual='/western/services/owdbLexis.asp'-->"
Case "Morningstar"
Response.Write "<!--#include

virtual='/western/services/owdbMStar.asp'-->"
Case "Oxford Press"
Response.Write "<!--#include
virtual='/western/services/owdbOxford.asp'-->"
Case "Vanderbilt"
Response.Write "<!--#include

virtual='/western/services/owdbVandy.asp'-->"
Case "Westlaw"
Response.Write "<!--#include
virtual='/western/services/owdbWestlaw.asp'-->"
Case "Wiley"
Response.Write "<!--#include

virtual='/western/services/owdbWiley.asp'-->"
Case Else
Response.Write "<h3>Please select a vendor. <br> <input type=button
value=Back onClick='history.back(1);'></h3>"

END SELECT

%>


Jul 19 '05 #7
The difference is the context switching in you If...ElseIf....

It's still icky, but you could do the same thing with Select Case...
<%
Select Case iChoice
Case "McGraw Hill"
%>
<!--#include virtual='/western/services/owdbMcGraw.asp'-->
<%
Case "Classical"
%>
<!--#include virtual="/western/services/owdbClassical.asp"-->
<%
End Select
%>

Bob Lehmann

"Kevin" <thersitz @yahoo com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
Thanks Aaron. My original working code was:

<%
If varVendor = "McGraw Hill" Then
%>
<!--#include virtual="/western/services/owdbMcGraw.asp"-->
<%
ElseIf varVendor = "Classical" Then
%>
<!--#include virtual="/western/services/owdbClassical.asp"-->
<%
ElseIf varVendor = "Lexis-Nexis" Then
%>
<!--#include virtual="/western/services/owdbLexis.asp"-->
<%
ElseIf varVendor = "Oxford Press" Then
%>
<!--#include virtual="/western/services/owdbOxford.asp"-->

and on and on -- etc.

But my string of If Then ElsIf statements is up to 15 and so I was trying to do the select case to reduce the statements. Guess I am back to the If Then ...ElseIf

I am sure I read that faq way back when and that is how I came to my
original If Then syntax.

Thanks
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Ou*************@tk2msftngp13.phx.gbl...
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"


You can't do this. Look at server.execute or see

http://www.aspfaq.com/2042

--
http://www.aspfaq.com/
(Reverse address to reply.)


Jul 19 '05 #8
Well, you could do this, but it is tedious and unmanageable, IMHO:

<%
SELECT CASE varVendor
CASE "McGraw Hill"
%>
<!--#include virtual=/western/services/owdbMcgraw.asp-->
<%
CASE "Classical"
%>
<!--#include virtual=/western/services/owdbClassical.asp-->
<%
...

Or better still, create an array or dictionary object that allows you to
match "McGraw-Hill" -> "owdbMcgraw.asp", then you could say this instead of
having 15 conditionals:

Set d = CreateObject("Scripting.Dictionary")
d.Add "McGraw Hill", "owdbMcgraw.asp"
d.Add "Classical", "osdbClassical.asp"
' ... add others here or populate from DB ...
Server.Execute d.item(varVendor)

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Kevin" <thersitz @yahoo com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
Thanks Aaron. My original working code was:

<%
If varVendor = "McGraw Hill" Then
%>
<!--#include virtual="/western/services/owdbMcGraw.asp"-->
<%
ElseIf varVendor = "Classical" Then
%>
<!--#include virtual="/western/services/owdbClassical.asp"-->
<%
ElseIf varVendor = "Lexis-Nexis" Then
%>
<!--#include virtual="/western/services/owdbLexis.asp"-->
<%
ElseIf varVendor = "Oxford Press" Then
%>
<!--#include virtual="/western/services/owdbOxford.asp"-->

and on and on -- etc.

But my string of If Then ElsIf statements is up to 15 and so I was trying to do the select case to reduce the statements. Guess I am back to the If Then ...ElseIf

I am sure I read that faq way back when and that is how I came to my
original If Then syntax.

Thanks
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Ou*************@tk2msftngp13.phx.gbl...
Case "McGraw Hill"
Response.Write "<!--#include
virtual='/western/services/owdbMcGraw.asp'-->"


You can't do this. Look at server.execute or see

http://www.aspfaq.com/2042

--
http://www.aspfaq.com/
(Reverse address to reply.)


Jul 19 '05 #9
On Fri, 27 Aug 2004 14:22:48 -0700, "Kevin" <thersitz @yahoo com>
wrote:
Thanks Aaron. My original working code was:

<%
If varVendor = "McGraw Hill" Then
%>
<!--#include virtual="/western/services/owdbMcGraw.asp"-->
<%
ElseIf varVendor = "Classical" Then
%>
<!--#include virtual="/western/services/owdbClassical.asp"-->
<%
ElseIf varVendor = "Lexis-Nexis" Then
%>
<!--#include virtual="/western/services/owdbLexis.asp"-->
<%
ElseIf varVendor = "Oxford Press" Then
%>
<!--#include virtual="/western/services/owdbOxford.asp"-->

and on and on -- etc.

Why not make it even easier to read & maintain. Put all the code in
your includes into several functions/Subs, eg:

<!--#include virtual="/western/services/owdbMcGraw.asp"-->
would contain

function DisplayMcGraw()
.....
end function

<!--#include virtual="/western/services/owdbClassical.asp"-->
contains:
function DisplayClassical()
.....
end function
or
<!--#include virtual="/western/services/owdbALL.asp"-->
would contain all the functions required in the owdb services.

Then include the file(s) at the very top of the page then in your
select case as:

SELECT CASE varVendor
CASE "McGraw Hill"
DisplayMcGraw()
CASE "Classical"
DisplayClasical()
....
.....
END SELECT
IMHO it looks more understanding and more maintainable. and your not
constantly swiching between asp & html code with <%.. %>
HTH

Al.

But my string of If Then ElsIf statements is up to 15 and so I was trying to
do the select case to reduce the statements. Guess I am back to the If Then
...ElseIf

I am sure I read that faq way back when and that is how I came to my
original If Then syntax.

Thanks
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:Ou*************@tk2msftngp13.phx.gbl...
> Case "McGraw Hill"
> Response.Write "<!--#include
> virtual='/western/services/owdbMcGraw.asp'-->"


You can't do this. Look at server.execute or see

http://www.aspfaq.com/2042

--
http://www.aspfaq.com/
(Reverse address to reply.)


Jul 19 '05 #10

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

Similar topics

10
by: Lakshmi Narayanan.R | last post by:
Hi Experts, Using keyword "To" in select case giving error.The following code is got from www.microsrosoft.com itself. What is the wrong with this?. <% Dim Number1 Number1 = 7 ' Initialize...
8
by: Penny | last post by:
Hi all, My browser throws this Select Case block back at me pointing out a syntax error on the line: 'Case < 251', between the word 'Case' and the '<' symbol. *************************** ...
25
by: CJM | last post by:
I'm getting a syntax error with a Select Case statement: Select Case CSng(rs.fields("Field1")) Case 0 Response.Write "Test1" Case Is < 0 <<< Syntax Error...
2
by: scole954387 | last post by:
Hi, I have a problem. I have written a SQL statement that has a nested select case statement on the 'where' clause to condition the results. ...
1
by: microsoft.public.dotnet.languages.vb | last post by:
Hi All, I wanted to know whether this is possible to use multiple variables to use in the select case statement such as follows: select case dWarrExpDateMonth, dRetailDateMonth case...
4
by: makinha | last post by:
Hello, I am getting a syntax error Microsoft VBScript compilation error '800a0400' Expected statement line 49 Case 164 To 269 ---------------^ (The error references...
1
jhardman
by: jhardman | last post by:
check out this thread in the asp forum. Poster is using VBscript and is asking a select case syntax question, but is a little too technical for me, I've never heard of trying this. Any of you VBers...
5
by: Adam Pelling | last post by:
I'm getting this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/neblncbt/public_html/forum/includes/acp/acp_board.php on line 69 Here is the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.