therayster
MIS
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> 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> <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>