Hello,
Hopefully, I am posting to the right newsgroup. I am getting the following
error on SQL Server 2005 using stored procedures on Win 2003 server. There
are records in the tables referring to CRF and AEPCC. The ASP code is
included below for aewk.asp and aewk_action.asp. I am not sure what is
wrong, as I am new to ASP and SQL programming. Thanks.
Error: "ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.
/aewk.asp, line 36"
Code: aewk.asp
<!--#include file="zgDBConnection.asp"-->
<html>
<head>
<style type="text/css">
table.border {
border-width: 4;
border-color: "brown";
border-style: solid;
}
</style>
<style>
.vert
{ writing-mode: tb-rl; }
</style>
<TITLE>Adverse Events</TITLE>
</head>
<body bgcolor="#008080">
<table width="600" class="border" bgcolor="#C0C0C0">
<form name="form1" method="post" action="aewk_action.asp">
<tr>
<%
Dim rsSelect_CRF_specific
Set rsSelect_CRF_specific=dbconn.Execute ("exec usp_Select_CRF_specific "
& request.form("SID"))
Dim zz_SID
Dim zz_Initials
Dim zz_Notes
Dim zz_Rand_ID
zz_SID = rsSelect_CRF_specific("SID")
zz_Initials = rsSelect_CRF_specific("Initials")
zz_Notes = rsSelect_CRF_specific("Notes")
zz_Rand_ID = rsSelect_CRF_specific("Rand_ID")
%>
<td>
<div align="center">Screen ID: <INPUT TYPE="int" SIZE=4 NAME="SID"
value="<%=zz_SID%>">
Initials: <INPUT TYPE="text" SIZE=8 NAME="Initials"
value="<%=zz_Initials%>">
Rand ID: <INPUT TYPE="int" SIZE=4 NAME="Rand_ID" value="<%=zz_Rand_ID%>">
</div>
<p>
<table width="360" align="left">
<input name="Section" type="hidden" value="Example_AddNew">
<tr>
<td colspan="8"><hr color="blue"></td>
</tr>
<tr>
<th align="center">Date</th>
<th align="center">Week</th>
<th align="center">Visit</th>
<th align="center">Eval_ID</th>
<th align="center">SID</th>
<th align="center">Track_ID</th>
<th align="center">Status</th>
</tr>
<tr>
<td align="center"><INPUT TYPE="date" SIZE=8 NAME="Date1"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="Week1"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="VisitNum"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="Eval_ID"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="SID"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="Track_ID"></td>
<td align="center"><INPUT TYPE="text" SIZE=8 NAME="Status""></td>
</tr>
<tr>
<td colspan="8" align="right">
<input class="button" value="Add New Record" type="Submit"
onmouseover="window.status='Click here for menu.';return true"
onMouseOut="window.status=''">
</td>
</tr>
</table>
<table width="140" align="right">
<tr>
<th align="left" valign="top" bgcolor="rgb(153,204,255)">
<div class="vert">Notes </div>
</th>
<td valign="top"><textarea NAME="notes" COLS="20" ROWS="10"
wrap="hard"
STYLE="scrollbar-base-color:brown;scrollbar-arrow-color:yellow;background-color:lightyellow;">
<%=zz_Notes%></textarea>
</td>
</tr>
<%
'Close and release the rs
rsSelect_CRF_specific.Close : Set rsSelect_CRF_specific=Nothing
%>
</table>
</td>
</tr>
</table>
<table width="642" class="border" bgcolor="#C0C0C0">
<input name="Section" type="hidden" value="Example_Edit">
<tr>
<td><div align="right">Mode: [<input name="Mode" type="radio" value="Edit"
checked>Edit | <input name="Mode" type="radio" value="Delete">Delete]</div>
<table>
<tr>
<th align="center">Date</th>
<th align="center">Week</th>
<th align="center">Visit</th>
<th align="center">Eval_ID</th>
<th align="center">SID</th>
<th align="center">Track_ID</th>
<th align="center">Status</th>
</tr>
<%
Dim rsSelect_AEPCC_spec
Set rsSelect_AEPCC_spec=dbconn.Execute ("exec usp_Select_AEPCC_spec " &
request.form("SID"))
If Not rsSelect_AEPCC_spec.eof Then
Do While Not rsSelect_AEPCC_spec.eof
DIM xx_Date1
DIM xx_Week1
DIM xx_VisitNum
DIM xx_Eval_ID
DIM xx_SID
DIM xx_Track_ID
DIM xx_Staus
xx_Date1 = rsSelect_AEPCC_spec("Date1")
xx_Week1 = rsSelect_AEPCC_spec("Week1")
xx_VisitNum = rsSelect_AEPCC_spec("VisitNum")
xx_Eval_ID = rsSelect_AEPCC_spec("Eval_ID")
xx_SID = rsSelect_AEPCC_spec("SID")
xx_Track_ID = rsSelect_AEPCC_spec("Track_ID")
xx_Status = rsSelect_AEPCC_spec("Status")
%>
<tr>
<td align="center"><INPUT TYPE="date" SIZE=8 NAME="Date1"
value="<%=xx_Date1%>"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="Week1"
value="<%=xx_Week1%>"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="VisitNum"
value="<%=xx_VisitNum%>"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="Eval_ID"
value="<%=xx_Eval_ID%>"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="SID"
value="<%=xx_SID%>"></td>
<td align="center"><INPUT TYPE="int" SIZE=2 NAME="Track_ID"
value="<%=xx_Track_ID%>"></td>
<td align="center"><INPUT TYPE="text" SIZE=8 NAME="Status"
value="<%=xx_Status%>"></td>
<td><input class="button" value="Edit" type="Submit"
onmouseover="window.status='Click here for menu.';return true"
onMouseOut="window.status=''"></td>
<td><input class="button" type="submit" value="AE"
onmouseover="window.status='Click here for menu.';return true"
onMouseOut="window.status=''" onclick="this.form.action='ae.asp';"></td>
</tr>
</td>
</tr>
</tr>
</table>
</td>
</tr>
</form>
</table>
<%
rsSelect_AEPCC_spec.MoveNext
Loop
'Close and release the rs
rsSelect_AEPCC_spec.Close : Set rsSelect_AEPCC_spec=Nothing
End If
'Close and release the connection
dbconn.Close : Set dbconn = Nothing
%>
</body>
</html>
Code: aewk_action.asp
<!--#include file="zgDBConnection.asp"-->
<%
'Option Explicit
Response.Expires=0
'Handles the date fields.
Public Function Handle_Date(varControl)
If Len(varControl) = 0 Then
Handle_Date = "Null"
Else
Handle_Date = "'" & varControl & "'"
End If
End Function
'Assigns Null for null text fields.
Public Function Handle_Text(varControl)
If Len(varControl) = 0 Then
Handle_Text = "Null"
Else
Handle_Text = "'" & replace(varControl,"'","''") & "'"
End If
End Function
'Assigns Null for null number fields.
Public Function Handle_Number(varControl)
If Len(varControl) = 0 Then
Handle_Number = "Null"
Else
Handle_Number = varControl
End If
End Function
Select Case request.form("Section")
Case "Example_AddNew"
'Execute the sp
dbconn.execute "exec usp_Insert_AEPCC " &_
Handle_Date(request.form("Date1")) & "," &_
Handle_Number(request.form("Week1")) & "," &_
Handle_Number(request.form("VisitNum")) & "," &_
Handle_Number(request.form("Eval_ID")) & "," &_
Handle_Number(request.form("SID")) & "," &_
Handle_Text(request.form("Track_ID")) & "," &_
Handle_Text(request.form("Status"))
Case "Example_Edit"
Select Case request.form("mode")
Case "Edit"
'Execute the sp
dbconn.execute "exec usp_Update_AEPCC " &_
Handle_Date(request.form("Date1")) & "," &_
Handle_Number(request.form("Week1")) & "," &_
Handle_Number(request.form("VisitNum")) & "," &_
Handle_Number(request.form("Eval_ID")) & "," &_
Handle_Number(request.form("SID")) & "," &_
Handle_Text(request.form("Track_ID")) & "," &_
Handle_Text(request.form("Status"))
Case "Delete"
'Execute the sp
dbconn.execute "exec usp_Delete_zztblTest " &_
Handle_Number(request.form("TestID_int"))
End Select
End Select
'Close and release the connection
dbconn.Close : Set dbconn = Nothing
'Bring up the same page.
Response.Redirect("aewk.asp")
%>