Help! I am going crazy trying to figure out this problem! I am trying to display a page showing which facilities in a certain region have submitted their daily information, and which have not. Showing the ones who have submitted is straightforward, and it's working fine. The other half is not going so well. Here is the error I'm getting:
Microsoft VBScript runtime (0x800A01A8)
Object required
/cplcanada/dailyreports/regions.asp, line 92
Two things: It's not telling me what's required, and the error is supposedly on line 92. The </html> tag, the last line of code, is on line 91! I'm going nuts! Here's the code:
===========================================================
<% 'Declare all variables
dim conn, conn2
dim rs
dim rs2
dim strconn, strconn2
dim cmd
dim strSQL, strSQL2, strSQL3
dim TodaysDate
dim inUID
'On Error Resume Next
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("fpdb/dailyreport.mdb"
%>
<html>
<head>
<title>Today's Regional Count</title>
</head>
<body>
<%
'Setup connection and recordset objects
set conn = server.createobject("adodb.connection"
conn.open strconn
set rs = server.createobject("adodb.recordset"
' Set SQL statement
TodaysDate=Date()
QueryRegion=request.querystring("region"
strSQL = "select * from Results where currentdate =#" & TodaysDate & "# and region like '" & QueryRegion & "'"
rs.Open strSQL,conn, adOpenStatic
if rs.EOF then
response.write"<font face=verdana size=2>No facilities from this region have submitted their data today.</font>"
'response.end
else
response.write"<p><font face=verdana size=2><b>The following facilities from the selected region have submitted their Daily Report:</b></font></p>"
response.write"<table>"
'Loop through the recordset displaying the search result
Do while Not rs.EOF
response.write"<tr><td><font face=verdana size=2>" & rs("facility" & "</font></td>"
response.write"<td align=center><font face=verdana size=2> <a href='display.asp?id=" & rs("ID" & "'>View Details</a></font></td></tr>"
rs.moveNext
loop
response.write"</table>"
end if
rs.close
set rs=nothing
'Setup connection and recordset objects
set conn2 = server.createobject("adodb.connection"
conn2.open strconn
set rs2 = server.createobject("adodb.recordset"
' Set SQL statement
strSQL2 = "SELECT FacilityName FROM Census WHERE Region='" & QueryRegion & "' AND FacilityName NOT IN (SELECT Facility FROM Results WHERE currentdate=#" & TodaysDate & "#)"
'response.write strSQL2
'response.end
rs2.Open strSQL2,conn2, adOpenStatic
if rs2.EOF then
response.write"<font face=verdana size=2>All of the facilities in this region have submitted their Daily Reports.</font>"
'response.end
else
response.write"<p><font face=verdana size=2><b>The following facilities from the selected region have not submitted their Daily Report...</b></font></p>"
response.write"<table><tr><td height=50> </td></tr>"
'Loop through the recordset displaying the search result
Do while Not rs2.EOF
response.write"<tr><td><font face=verdana size=2>" & rs2("FacilityName" & "</font></td></tr>"
rs.moveNext
loop
response.write"</table>"
end if
rs2.close
set rs2 = nothing
%>
</body>
</html>
==========================================================
Any suggestions would be greatly appreciated!
TIA,
Brenda
Microsoft VBScript runtime (0x800A01A8)
Object required
/cplcanada/dailyreports/regions.asp, line 92
Two things: It's not telling me what's required, and the error is supposedly on line 92. The </html> tag, the last line of code, is on line 91! I'm going nuts! Here's the code:
===========================================================
<% 'Declare all variables
dim conn, conn2
dim rs
dim rs2
dim strconn, strconn2
dim cmd
dim strSQL, strSQL2, strSQL3
dim TodaysDate
dim inUID
'On Error Resume Next
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("fpdb/dailyreport.mdb"
%>
<html>
<head>
<title>Today's Regional Count</title>
</head>
<body>
<%
'Setup connection and recordset objects
set conn = server.createobject("adodb.connection"
conn.open strconn
set rs = server.createobject("adodb.recordset"
' Set SQL statement
TodaysDate=Date()
QueryRegion=request.querystring("region"
strSQL = "select * from Results where currentdate =#" & TodaysDate & "# and region like '" & QueryRegion & "'"
rs.Open strSQL,conn, adOpenStatic
if rs.EOF then
response.write"<font face=verdana size=2>No facilities from this region have submitted their data today.</font>"
'response.end
else
response.write"<p><font face=verdana size=2><b>The following facilities from the selected region have submitted their Daily Report:</b></font></p>"
response.write"<table>"
'Loop through the recordset displaying the search result
Do while Not rs.EOF
response.write"<tr><td><font face=verdana size=2>" & rs("facility" & "</font></td>"
response.write"<td align=center><font face=verdana size=2> <a href='display.asp?id=" & rs("ID" & "'>View Details</a></font></td></tr>"
rs.moveNext
loop
response.write"</table>"
end if
rs.close
set rs=nothing
'Setup connection and recordset objects
set conn2 = server.createobject("adodb.connection"
conn2.open strconn
set rs2 = server.createobject("adodb.recordset"
' Set SQL statement
strSQL2 = "SELECT FacilityName FROM Census WHERE Region='" & QueryRegion & "' AND FacilityName NOT IN (SELECT Facility FROM Results WHERE currentdate=#" & TodaysDate & "#)"
'response.write strSQL2
'response.end
rs2.Open strSQL2,conn2, adOpenStatic
if rs2.EOF then
response.write"<font face=verdana size=2>All of the facilities in this region have submitted their Daily Reports.</font>"
'response.end
else
response.write"<p><font face=verdana size=2><b>The following facilities from the selected region have not submitted their Daily Report...</b></font></p>"
response.write"<table><tr><td height=50> </td></tr>"
'Loop through the recordset displaying the search result
Do while Not rs2.EOF
response.write"<tr><td><font face=verdana size=2>" & rs2("FacilityName" & "</font></td></tr>"
rs.moveNext
loop
response.write"</table>"
end if
rs2.close
set rs2 = nothing
%>
</body>
</html>
==========================================================
Any suggestions would be greatly appreciated!
TIA,
Brenda