Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Expected 'End'

Status
Not open for further replies.
Mar 4, 2001
43
US
Okay, I'm stumped. This is real simple stuff, but I can't find the error and need another pair of eyes. Getting error "Microsoft VBScript compilation error '800a03f6'|Expected 'End'|/it/timesheet2.asp, line 110" Line 110 is the line at the end terminating the ADO connection. I've been looking for an unterminated 'If...then' or Loop, but I must be missing it. Help would be greatly appreciated.

Code:
<html>
<head>
<%@ Language=VBScript %>

<%
dim UID
	if Request.QueryString("UID")="" then
		empFilter = ""
	else
		UID = Request.QueryString("UID")
		empFilter = "tTimeEntry.EmployeeID=" & cInt(UID) & " AND " 
	End If

	Dim pStart
		if Request.QueryString("pStart")="" then
		pStart = Now-7
	else
		pStart = Request.QueryString("pStart")
	End If

dim inputSQL1
inputSQL1 = "SELECT tTimeEntry.EmployeeID, tTimeEntry.Date, tTimeEntry.ProjectID, tTimeEntry.DesignCode, tTimeEntry.Description, tTimeEntry.Hours, tTimeEntry.Mileage, tTimeEntry.Class FROM tTimeEntry WHERE " & empFilter & "tTimeEntry.Date>=#" & pStart & "# ORDER BY tTimeEntry.Date;"

inputSQL2 = "SELECT DISTINCT tEmployeeID.EmployeeID, tEmployeeID.EmployeeFirst, tEmployeeID.EmployeeLast FROM tEmployeeID WHERE tEmployeeID.EmployeeID>0;"

Function writeTable()
	Dim color
	
	Response.Write "<table cellpadding='5' cellspacing='1' bgcolor='#C0C0C0' border='0' width='90%' height='50'>"
	Response.Write "<tr><td  align='center'><font face='Calisto MT'>Emp ID</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Project Num</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Date</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Design Code</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Work Class</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Description</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Hours</font></td>"
	Response.Write "<td align='center'><font face='Calisto MT'>Miles</font></td></tr>"

	rs1.Movefirst
	color = "#FFFFFF"
	Do while not rs1.EOF
		Response.Write "<tr><td width='72' bgcolor=" & color & " align='center'>" & rs1(0) & "</td>"
		Response.Write "<td width='76' bgcolor=" & color & " align='center'>" & rs1(2) & "</td>"
		Response.Write "<td width='48' bgcolor=" & color & " align='center'>" & rs1(1) & "</td>"
		Response.Write "<td width='35' bgcolor=" & color & " align='center'>" & rs1(3) & "</td>"
		Response.Write "<td width='42' bgcolor=" & color & " align='center'>" & rs1(7) & "</td>"
		Response.Write "<td width='773' bgcolor=" & color & " align='left'><i>" & rs1(4) & "</i></td>"
		Response.Write "<td width='37' bgcolor=" & color & " align='center'>" & rs1(5) & "</td>"
		Response.Write "<td height='24' width='33' bgcolor=" & color & " align='center'>" & rs1(6) & "</td></tr>"
	
		If color="#FFFFFF" then
			color="#C0C0C0"
		else
			color = "#FFFFFF"
		end if
	
		rs1.MoveNext
	Loop
	
	Response.Write "</table>"
End Function
%>
<!--#include file="connection.asp"-->
<!--#include File="RS1.asp"-->
<!--#include File="RS2.asp"-->
<script language="javascript" src="popup_calendar/script.js" type="text/javascript"></script>
<Title>Ray's Test Time Entry Page</title>
</head>

<body>
<div align="center">
	<form name="setParam" method="Get" action="timesheet.asp">
		<p><font face="Calisto MT">Employee ID: 
		<select size="1" name="UID">
		<option value=""></option>
		<%
		RS2.MoveFirst
		
		Do While Not RS2.EOF
			Response.Write "<option value=" & RS2(0) & ">" & RS2(0) & "|" & RS2(1) & " " & RS2(2) &"</option>"
			RS2.MoveNext
		Loop
		
		RS2.Close
		Set RS2 = Nothing
		%>
		</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Period Start Date:
		<input type="text" name="pStart" size="20" id="pStt"><a href="javascript:OpenCalendar('pStart', false)"><img height="16" src="popup_calendar/icon-calendar.gif" width="24" align="absMiddle" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></font></p>
	</form>
	</div>

<div align="center">
<%
IF rs1.eof = true then
	Response.Write "<font face='Calisto MT'>No Records Found for User " & UID & " for the period starting on " & pStart & ".</font>"
else if isnull(UID) then
	Response.Write "<font face='Calisto MT'>Records for all users for the period starting on " & pStart & ".</font><br>"
	writeTable()
Else
	Response.Write "<font face='Calisto MT'>Records for User " & UID & " for the period starting on " & pStart & ".</font><br>"
	writeTable()
End If

rs1.Close
Set rs1 = Nothing
%>

<%
conn.Close
Set conn = Nothing
%>

</body>
</html>
 
Replace this:
else if isnull(UID) then
with this:
ElseIf IsNull(UID) Then

And this:
writeTable()
with this:
writeTable

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top