I am getting the following message when I load a page:
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/teddy/Screening.asp, line 281
The strange thing is that I didn't make any changes to the connection, just changed the criteria in the stored procedure and added some text to the page. It was working fine before.
Another strange thing is that if I refresh the page using the browser refresh button, it works fine. I tried putting in code to refresh the page, but that did not work using this code in the head:
<META http-EQUIV="Pragma" CONTENT="no-cache">
<META http-EQUIV="Expires" CONTENT="-1">
The purpose of this page is to provide users with a way to look up people, either from a dropdown list or by entering some of the last name or the ID #.
Here is the relevant code:
<%
set ListScreened = Server.CreateObject("ADODB.Command")
ListScreened.ActiveConnection = MM_Teddy_STRING
ListScreened.CommandText = "dbo.pr_ListScreeningStatus"
ListScreened.CommandType = 4
ListScreened.CommandTimeout = 0
ListScreened.Prepared = true
ListScreened.Parameters.Append ListScreened.CreateParameter("@name", 200, 1,4,Session("Name"))
ListScreened.Parameters.Append ListScreened.CreateParameter("@who", 129, 1,7,Session("Who"))
ListScreened.Parameters.Append ListScreened.CreateParameter("@idDCC", adInteger, 1,4,Session("ID"))
set ScreenedList = ListScreened.Execute
ScreenedList_numRows = 0
%>
<%
If request.Form("name") = "" Then
Session("Name") = null
Else
Session("Name") = request.Form("name")
End If
If Request.Form("Who") = "" Then
Session("Who") = null
Else
Session("Who") = request.Form("Who")
End If
If Request.Form("ID") = "" Then
Session("ID") = null
Else
Session("ID") = request.Form("ID")
End If
%>
<%
If request.Form("Next") <> "" THEN
response.Redirect("Screening.asp")
End If
%>
<%
If request.Form("Search") <> "" Then
varIdDCC = request.Form("idDCC")
Session("idDCC") = varIdDCC
response.Redirect("ViewScreened.asp")
End if
%>
<%
If request.Form("Clear") <> "" Then
Session("Name") = null
Session("Who") = null
Session("ID") = null
response.Redirect("Screening.asp")
End If
%>
<form action="" method="post" name="formLookup" id="formLookup">
<table width="650" border="0">
<tr>
<td colspan="3" class="StyleLabelsSmall">Search for a screened subject:</td>
<td width="50"> </td>
</tr>
<tr>
<td width="200" class="StyleLabelsSmall">By last name: <br>
<span class="StyleText"><em>(name at time of screening)</em></span></td>
<td width="220" class="StyleText">Subject or Mother </td>
<td width="100"><select name="Who" id="Who">
<option value="Subject">Subject</option>
<option value="Mother">Mother</option>
</select></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class="StyleText">First letters of last name </td>
<td><input name="Name" type="text" class="StyleText" id="Name" size="6" maxlength="4">
<span class="StyleText">(up to 4) </span> </td>
<td> </td>
</tr>
<tr>
<td class="StyleLabelsSmall">By DCC ID#: </td>
<td> </td>
<td><input name="ID" type="text" id="ID" size="10" maxlength="8"></td>
<td><input name="Next" type="submit" id="Next" value="Next"></td>
</tr>
<tr>
<td colspan="4" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><select name="idDCC" id="idDCC">
<%
While (NOT ScreenedList.EOF)
***** ^^^^^This is the line 281 from the error message*****
%>
<option value="<%=(ScreenedList.Fields.Item("idDCC").Value)%>"><%=(ScreenedList.Fields.Item("Fullname").Value)%></option>
<%
ScreenedList.MoveNext()
Wend
If (ScreenedList.CursorType > 0) Then
ScreenedList.MoveFirst
Else
ScreenedList.Requery
End If
%>
</select> <input name="Search" type="submit" id="Search" value="Select">
<input name="Clear" type="reset" id="Clear" value="Clear"></td>
<td> </td>
</tr>
</table>
</form>
Thanks in advance!!
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/teddy/Screening.asp, line 281
The strange thing is that I didn't make any changes to the connection, just changed the criteria in the stored procedure and added some text to the page. It was working fine before.
Another strange thing is that if I refresh the page using the browser refresh button, it works fine. I tried putting in code to refresh the page, but that did not work using this code in the head:
<META http-EQUIV="Pragma" CONTENT="no-cache">
<META http-EQUIV="Expires" CONTENT="-1">
The purpose of this page is to provide users with a way to look up people, either from a dropdown list or by entering some of the last name or the ID #.
Here is the relevant code:
<%
set ListScreened = Server.CreateObject("ADODB.Command")
ListScreened.ActiveConnection = MM_Teddy_STRING
ListScreened.CommandText = "dbo.pr_ListScreeningStatus"
ListScreened.CommandType = 4
ListScreened.CommandTimeout = 0
ListScreened.Prepared = true
ListScreened.Parameters.Append ListScreened.CreateParameter("@name", 200, 1,4,Session("Name"))
ListScreened.Parameters.Append ListScreened.CreateParameter("@who", 129, 1,7,Session("Who"))
ListScreened.Parameters.Append ListScreened.CreateParameter("@idDCC", adInteger, 1,4,Session("ID"))
set ScreenedList = ListScreened.Execute
ScreenedList_numRows = 0
%>
<%
If request.Form("name") = "" Then
Session("Name") = null
Else
Session("Name") = request.Form("name")
End If
If Request.Form("Who") = "" Then
Session("Who") = null
Else
Session("Who") = request.Form("Who")
End If
If Request.Form("ID") = "" Then
Session("ID") = null
Else
Session("ID") = request.Form("ID")
End If
%>
<%
If request.Form("Next") <> "" THEN
response.Redirect("Screening.asp")
End If
%>
<%
If request.Form("Search") <> "" Then
varIdDCC = request.Form("idDCC")
Session("idDCC") = varIdDCC
response.Redirect("ViewScreened.asp")
End if
%>
<%
If request.Form("Clear") <> "" Then
Session("Name") = null
Session("Who") = null
Session("ID") = null
response.Redirect("Screening.asp")
End If
%>
<form action="" method="post" name="formLookup" id="formLookup">
<table width="650" border="0">
<tr>
<td colspan="3" class="StyleLabelsSmall">Search for a screened subject:</td>
<td width="50"> </td>
</tr>
<tr>
<td width="200" class="StyleLabelsSmall">By last name: <br>
<span class="StyleText"><em>(name at time of screening)</em></span></td>
<td width="220" class="StyleText">Subject or Mother </td>
<td width="100"><select name="Who" id="Who">
<option value="Subject">Subject</option>
<option value="Mother">Mother</option>
</select></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class="StyleText">First letters of last name </td>
<td><input name="Name" type="text" class="StyleText" id="Name" size="6" maxlength="4">
<span class="StyleText">(up to 4) </span> </td>
<td> </td>
</tr>
<tr>
<td class="StyleLabelsSmall">By DCC ID#: </td>
<td> </td>
<td><input name="ID" type="text" id="ID" size="10" maxlength="8"></td>
<td><input name="Next" type="submit" id="Next" value="Next"></td>
</tr>
<tr>
<td colspan="4" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><select name="idDCC" id="idDCC">
<%
While (NOT ScreenedList.EOF)
***** ^^^^^This is the line 281 from the error message*****
%>
<option value="<%=(ScreenedList.Fields.Item("idDCC").Value)%>"><%=(ScreenedList.Fields.Item("Fullname").Value)%></option>
<%
ScreenedList.MoveNext()
Wend
If (ScreenedList.CursorType > 0) Then
ScreenedList.MoveFirst
Else
ScreenedList.Requery
End If
%>
</select> <input name="Search" type="submit" id="Search" value="Select">
<input name="Clear" type="reset" id="Clear" value="Clear"></td>
<td> </td>
</tr>
</table>
</form>
Thanks in advance!!