468,290 Members | 1,854 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

where to put 'end'??

Nat
Hi there,
I have code as following but it returns error
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/urbisjhdintranet/metadata/resultList.asp, line 324
which is the second last line at the end of the code. I have no idea
where to put 'end'. It would be great if anyone could help.
Thanks heaps!
Nat

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/metadata.asp" -->
<%
Dim resultlist_varSupplier
Dim resultlist_varDataset
Dim resultlist_varDatamgr
Dim resultlist_varKeyword
resultlist_varSupplier = "%"
resultlist_varDataset = "%"
resultlist_varDatamgr = "%"
resultlist_varKeyword = "%"
if (Request.Form("lstSupplier") <> "") then
resultlist_varSupplier = Replace(Request.Form("lstSupplier"), "'",
"''")
if (Request.Form("lstDataset") <> "") then
resultlist_varDataset = Replace(Request.Form("lstDataset"), "'", "''")
if (Request.Form("lstDatamgr") <> "") then
resultlist_varDatamgr = Replace(Request.Form("lstDatamgr"), "'", "''")
if (Request.Form("txtKeyword") <> "") then
resultlist_varKeyword = Replace(Request.Form("txtKeyword"), "'", "''")

varSearch = ""
wherecheck = 0
if resultlist_varSupplier <> "%" then
varSearch = "WHERE CompanyName = '"&resultlist_varSupplier&"'"
wherecheck = 1
end if
if resultlist_varDataset <> "%" then
if wherecheck = 1 then
varSearch = varSearch&" and Parent_Dataset_Name =
'"&resultlist_varDataset&"'"
else
varSearch = "WHERE Parent_Dataset_Name =
'"&resultlist_varDataset&"'"
wherecheck = 1
end if
end if
if resultlist_varDatamgr <> "%" then
if wherecheck = 1 then
varSearch = varSearch&" and Name =
'"&resultlist_varDatamgr&"'"
else
varSearch = "WHERE Name = '"&resultlist_varDatamgr&"'"
wherecheck = 1
end if
end if
if resultlist_varKeyword <> "%" then
if wherecheck = 1 then
varSearch = varSearch&" and Keyword =
'"&resultlist_varKeyword&"'"
else
varSearch = "WHERE Keyword = '"&resultlist_varKeyword&"'"
end if
end if

set resultlist = Server.CreateObject("ADODB.Recordset")
resultlist.ActiveConnection = MM_metadata_STRING
resultlist.Source = "SELECT Child_Dataset_ID, Parent_Dataset_ID,
Parent_Dataset_Name, ChildDataset_Name, Dataset_StartDate,
Dataset_EndDate, Dataset_Type, Projections, Version, Cost, License,
Copyright, Last_Updated, Quality, Format, Filesize, FileLocation,
Source, CompanyName, Name, Keyword FROM qryAlldata " & varSearch & "
ORDER BY ChildDataset_Name"
resultlist.CursorType = 0
resultlist.CursorLocation = 2
resultlist.LockType = 3
resultlist.Open()
resultlist_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
resultlist_numRows = resultlist_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining
URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" &
MM_paramName & "=" End If
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_kee pNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem &
Server.URLencode(Request.QueryString(Item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem &
Server.URLencode(Request.Form(Item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of
the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth,
Len(MM_keepBoth) - 1) End If
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL,
Len(MM_keepURL) - 1) End If
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm,
Len(MM_keepForm) - 1) End If

' a utility function used for adding additional parameters to these
strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0035)http://www.urbisjhd.com/careers.htm -->
<HTML>
<!-- #BeginTemplate "/Templates/main_template.dwt" -->
<HEAD>
<!-- #BeginEditable "doctitle" -->
<TITLE>UrbisJHD :: Metadata Database</TITLE>
<!-- #EndEditable -->
<META http-equiv=Content-Type content="text/html;
charset=windows-1252">
<!-- #BeginEditable "script" -->
<SCRIPT src="js.js"></SCRIPT>
<NOSCRIPT>
<LINK href="ie.css" type=text/css
rel=styleSheet>
</NOSCRIPT><!-- #EndEditable -->
<META http-equiv=imagetoolbar content=no>
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
</HEAD>
<BODY bottomMargin=0 bgColor=#ffffff leftMargin=0 topMargin=0
rightMargin=0
marginwidth="0" marginheight="0">
<!--Start : logo-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><A onmouseover="javascript:GB_statusMsg('Homepage'); return
true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://www.urbisjhd.com/default.htm"><IMG height=84
src="../Images/urbis.gif" width=154 border=0></A></TD>
<TD width="100%">
<div align="center"><img src="../Images/Intranet_new.jpg"
width="250" height="84"></div>
</TD>
<TD><IMG height=84 src="../Images/top_dots.gif" width=193
border=0></TD>
</TR>
</TBODY>
</TABLE>
<!--End : logo-->
<!--Start : nav-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=154><img src="../Images/blank.gif" width="154"
height="15"></TD>
<TD onmouseup="javascript:window.location.href='home.h tm';"
class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('Home Page'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;" noWrap><A
class=mainnavlink
onmouseover="javascript:GB_statusMsg('Home page'); return true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="../home.htm">Home</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/UrbisJHD
Inside.htm';" class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('Inside UrbisJHD'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('Inside UrbisJHD'); return
true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://web01/urbisjhdintranet/UrbisJHD%20%20Inside.htm">Inside
UrbisJHD</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/UrbisJHD
KCP.htm';"
class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('KCP'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('KCP'); return true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://web01/urbisjhdintranet/UrbisJHD%20KCP.htm">KCP</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/UrbisJHD
Services.htm';"
class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('Staff Services'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('Staff Services'); return
true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://web01/urbisjhdintranet/UrbisJHD%20%20Services.htm">Staff
Services</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/UrbisJHD
Forum.htm';" class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('UrbisJHD Forum'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('UrbisJHD Forum'); return
true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://web01/urbisjhdintranet/UrbisJHD%20%20Forum.htm">UrbisJHD
Forum</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/phonelist/urbisjhd
phone list.asp';"
class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('Phone List'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('Phone List'); return
true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://web01/urbisjhdintranet/phonelist/urbisjhd phone
list.asp">Phone
List</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/UrbisJHD
Portals.htm';"
class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('Portals'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('Portals'); return true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="../UrbisJHD%20Portals.htm">Portals</A></TD>
<TD onmouseup="javascript:window.location.href='http://web01/urbisjhdintranet/UrbisJHD
Links.htm';"
class=mainnav
onmouseover="javascript:this.className='mainnavove r';
GB_statusMsg('Links'); return true;"
onmouseout="javascript:this.className='mainnav'; GB_statusMsg('');
return true;"
noWrap><A class=mainnavlink
onmouseover="javascript:GB_statusMsg('Links'); return true;"
onfocus=javascript:this.blur();
onmouseout="javascript:GB_statusMsg(''); return true;"
href="http://web01/urbisjhdintranet/UrbisJHD%20Links.htm">Links</A></TD>
<TD width="100%" class=sitecolour>&nbsp;</TD>
<TD width="100%" class=sitecolour>&nbsp;</TD>
</TR>
</TBODY>
</TABLE>
<!--End : nav-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><IMG height=1 src="/Images/blank.gif" width=27
border=0></TD>
<TD vAlign=top><BR>
<!-- #BeginEditable "header" --><SPAN class=header>Search
Results</SPAN><!-- #EndEditable --><BR>
<BR>
<!-- #BeginEditable "content" -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top width="480">
<%Response.Write Request.Form("txtKeyword")%>
</TD>
</TR>
</TBODY>
</TABLE>
<table>
<TR>
<TD vAlign=top width="466" class="boldwhitetext"
bgcolor="#AEAE55">ChildDataset</TD>
<TD vAlign=top width="466" class="boldwhitetext"
bgcolor="#AEAE55">ParentDataset</TD>
<TD vAlign=top width="466" class="boldwhitetext"
bgcolor="#AEAE55">Data_EndDate</TD>
<TD vAlign=top width="466" class="boldwhitetext"
bgcolor="#AEAE55">Data_Type</TD>
<TD vAlign=top width="466" class="boldwhitetext"
bgcolor="#AEAE55">Projections</TD>
<TD vAlign=top width="466" class="boldwhitetext"
bgcolor="#AEAE55">...</TD>
</tr>
<%
Dim RecordCounter
RecordCounter = 0
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT resultlist.EOF))
%>
<TR>
<TD vAlign=top>
<%=(resultlist.Fields.Item("ChildDataset_Name").Va lue)%></TD>
<TD vAlign=top>
<%=(resultlist.Fields.Item("Parent_Dataset_Name"). Value)%></TD>
<TD vAlign=top>
<%=(resultlist.Fields.Item("Dataset_EndDate").Valu e)%></TD>
<TD vAlign=top>
<%=(resultlist.Fields.Item("Dataset_Type").Value)% ></TD>
<TD vAlign=top>
<%=(resultlist.Fields.Item("Projections").Value)%> </TD>
<TD vAlign=top>
<A HREF="ListDetail.asp?<%= "Child_Dataset_ID=" &
resultlist.Fields.Item("Child_Dataset_ID").Value %>">details</A></TD>
</TR>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
resultlist.MoveNext()
Wend
%>
</table>
<!-- #EndEditable -->
<!--End : content-->
<!--spacer-->
<IMG height=1
src="/Images/blank.gif" width=480 border=0> </TD>
<TD width="100%"><IMG height=15 src="../Images/blank.gif"
width=17 border=0></TD>
<TD class=subnavbgcolour vAlign=top><!-- #BeginEditable "image"
--><IMG height=51
src="../Images/careers.jpg" width=192 border="0"><!--
#EndEditable -->
<TABLE cellPadding=10>
<TBODY>
<TR>
<TD valign="top">
<!--Start : subnav-->
<!-- #BeginEditable "subnav" --> <!-- #EndEditable -->
<!--end : subnav-->
</TD>
</TR>
</TBODY>
</TABLE>
<BR>
<BR>
<IMG height=1
src="/Images/blank.gif" width=193 border=0> </TD>
</TR>
</TBODY>
</TABLE>
<!--Start : bottom dots-->
<BR>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD width="100%" background="../Images/btm_dots.gif"><IMG
height=39 src="../Images/blank.gif" width=1 border=0></TD>
<TD><IMG height=1 src="../Images/blank.gif" width=193
border=0></TD>
</TR>
</TBODY>
</TABLE>
<!--End : bottom dots-->
</BODY>
<!-- #EndTemplate -->
</HTML>
<%
resultlist.Close()
%>
Jul 19 '05 #1
2 1740
> if (Request.Form("lstSupplier") <> "") then
resultlist_varSupplier = Replace(Request.Form("lstSupplier"), "'",
"''")


If you are moving the resultlist_varSupplier = code to the next line, then
you must place an End If after, e.g.

If something Then
do_something
End If

If you keep it all on the same line then the end if is omitted, e.g.

If something Then do_something

(Man, does Dreamweaver ever make big ugly code...)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


Jul 19 '05 #2
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message news:<#8*************@TK2MSFTNGP11.phx.gbl>...
if (Request.Form("lstSupplier") <> "") then
resultlist_varSupplier = Replace(Request.Form("lstSupplier"), "'",
"''")


In this case it would be
if (Request.Form("lstSupplier") <> "") then
resultlist_varSupplier = Replace(Request.Form
("lstSupplier"), "'","''")
End If

Enjoy
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Alex Vorobiev | last post: by
4 posts views Thread by Brian Shannon | last post: by
41 posts views Thread by Miroslaw Makowiecki | last post: by
2 posts views Thread by Ceebaby via AccessMonster.com | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.