[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

Getting error "Either BOF or EOF is True..."

Raz

3/20/2007 5:59:00 PM

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%>">&nbsp;&nbsp;&nbsp;&nbsp;
Initials: <INPUT TYPE="text" SIZE=8 NAME="Initials"
value="<%=zz_Initials%>">&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;</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")
%>





3 Answers

Aaron [SQL Server MVP]

3/20/2007 6:14:00 PM

0

Is it possible that you are calling the stored procedures and they are not
returning results?

Typically you test this after opening the recordset, e.g.

If (recordsetObjectName.EOF) Then
Response.Write "Sorry, empty"
Else
Do While Not recordsetObjectName.EOF
...
recordsetObjectName.MoveNext()
Loop
End If

If you are sure that the stored procedures are returning results, then you
might want to make sure that the stored procedures use SET NOCOUNT ON; at
the beginning to prevent count messages from intermediate activities (e.g.
selecting into a #temp table) from fooling ADO.

--
Aaron Bertrand
SQL Server MVP
http://www.sq...
http://www.aspfa...





"Raz" <mrmac444@yahoo.com> wrote in message
news:eyIPUlxaHHA.1300@TK2MSFTNGP02.phx.gbl...
> 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%>">&nbsp;&nbsp;&nbsp;&nbsp;
> Initials: <INPUT TYPE="text" SIZE=8 NAME="Initials"
> value="<%=zz_Initials%>">&nbsp;&nbsp;&nbsp;&nbsp;
> 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&nbsp;</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")
> %>
>
>
>
>
>


Raz

3/20/2007 6:50:00 PM

0

I tried what you suggested but, I am still getting that error. Here is what
I have for the stored procedure:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[usp_Insert_AEPCC]

@Date1 datetime = Null,
@Week1 nvarchar(50) = NULL,
@VisitNum nvarchar(50) = NULL,
@Eval_ID nvarchar(50) = Null,
@SID int = notNull,
@Track_ID text = Null,
@Status text = Null

AS
SET NOCOUNT ON

INSERT INTO AEPCC
(Date1,
Week1,
VisitNum,
Eval_ID,
SID,
Track_ID,
Status)

VALUES
(@Date1,
@Week1,
@VisitNum,
@Eval_ID,
@SID,
@Track_ID,
@Status)

"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:ubBKWuxaHHA.4552@TK2MSFTNGP05.phx.gbl...
> Is it possible that you are calling the stored procedures and they are not
> returning results?
>
> Typically you test this after opening the recordset, e.g.
>
> If (recordsetObjectName.EOF) Then
> Response.Write "Sorry, empty"
> Else
> Do While Not recordsetObjectName.EOF
> ...
> recordsetObjectName.MoveNext()
> Loop
> End If
>
> If you are sure that the stored procedures are returning results, then you
> might want to make sure that the stored procedures use SET NOCOUNT ON; at
> the beginning to prevent count messages from intermediate activities (e.g.
> selecting into a #temp table) from fooling ADO.
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sq...
> http://www.aspfa...
>
>
>
>
>
> "Raz" <mrmac444@yahoo.com> wrote in message
> news:eyIPUlxaHHA.1300@TK2MSFTNGP02.phx.gbl...
>> 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%>">&nbsp;&nbsp;&nbsp;&nbsp;
>> Initials: <INPUT TYPE="text" SIZE=8 NAME="Initials"
>> value="<%=zz_Initials%>">&nbsp;&nbsp;&nbsp;&nbsp;
>> 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&nbsp;</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")
>> %>
>>
>>
>>
>>
>>
>
>


Aaron [SQL Server MVP]

3/20/2007 7:11:00 PM

0

> ALTER PROCEDURE [dbo].[usp_Insert_AEPCC]
>
> @Date1 datetime = Null,
> @Week1 nvarchar(50) = NULL,
> @VisitNum nvarchar(50) = NULL,
> @Eval_ID nvarchar(50) = Null,
> @SID int = notNull,
> @Track_ID text = Null,
> @Status text = Null
>
> AS
> SET NOCOUNT ON
>
> INSERT INTO AEPCC
> (Date1,
> Week1,
> VisitNum,
> Eval_ID,
> SID,
> Track_ID,
> Status)
>
> VALUES
> (@Date1,
> @Week1,
> @VisitNum,
> @Eval_ID,
> @SID,
> @Track_ID,
> @Status)


This stored procedure doesn't have a SELECT statement. A SELECT statement
is kind of essential for a recordset to make sense. Otherwise, you should
just be saying connectionObject.Execute "procedureName"