SQL data
am 07.05.2007 18:50:04 von RazHello,
I have setup a session id that pulls up the current record that is selected
from the asp page, but somehow the last record is always being pulled up.
Any ideas why? Code is below. ASP Page1 is the page where user clicks to
retrieve data from SQL and ASP Page2 displays the data. Thanks.
SP:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[usp_Select_BDIPCC_spec]
@SID int
AS
SET NOCOUNT ON
SELECT * FROM BDIPCC WHERE SID = @SID ORDER BY SID
ASP Page1:
table width="600" bgcolor="#C0C0C0">
<%
Dim rsSelect_BDIPCC_spec
Set rsSelect_BDIPCC_spec=dbconn.Execute ("exec usp_Select_BDIPCC_spec " &
Session("SID"))
If Not rsSelect_BDIPCC_spec.eof Then
Do While Not rsSelect_BDIPCC_spec.eof
DIM xx_BDIPCC_ID
DIM xx_Date1
DIM xx_Week1
DIM xx_Eval_ID
DIM xx_SID
DIM xx_Track_ID
DIM xx_Staus
DIM xx_Rand_ID
xx_BDIPCC_ID = rsSelect_BDIPCC_spec("BDIPCC_ID")
xx_Date1 = rsSelect_BDIPCC_spec("Date1")
xx_Week1 = rsSelect_BDIPCC_spec("Week1")
xx_VisitNum = rsSelect_BDIPCC_spec("VisitNum")
xx_Eval_ID = rsSelect_BDIPCC_spec("Eval_ID")
xx_SID = rsSelect_BDIPCC_spec("SID")
xx_Track_ID = rsSelect_BDIPCC_spec("Track_ID")
xx_Status = rsSelect_BDIPCC_spec("Status")
xx_Rand_ID = rsSelect_BDIPCC_spec("Rand_ID")
%>
<%
rsSelect_BDIPCC_spec.MoveNext
Loop
'Close and release the rs
rsSelect_BDIPCC_spec.Close : Set rsSelect_BDIPCC_spec=Nothing
End If
'Close and release the connection
dbconn.Close : Set dbconn = Nothing
%>
ASP Page2:
<%
'Close and release the rs
rsSelect_CRF_specific.Close : Set rsSelect_CRF_specific=Nothing
'Close and release the connection
dbconn.Close : Set dbconn = Nothing
%>
onmouseover="window.status='Click here for menu.';return true" onMouseOut="window.status=''" onclick="this.form.action='bdiform.asp';"> |
<%response.write xx_BDIPCC_ID
response.end%>