[quoted text, click to view] Raz wrote:
> Hello,
>
> 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.
First step:
Run the stored procedure in Query Analyzer using the SID you are passing
from ASP (you should Response.Write Session("SID") to verify that it
contains what you expect) and verify that the procedure returns the expected
records. If it does, then it's time to look at your asp code.
As for the code, please snip out irrelevant html.
[quoted text, click to view] > ASP Page1:
>
<snip>
> <%
> Dim rsSelect_BDIPCC_spec
> Set rsSelect_BDIPCC_spec=dbconn.Execute ("exec
> usp_Select_BDIPCC_spec " & Session("SID"))
I would have done it this way (here's why:
http://groups.google.com/group/microsoft.public.inetserver.asp.general/msg/5d3c9d4409dc1701?hl=en):
set rsSelect=CreateObject("adodb.recordset")
dbconn.usp_Select_BDIPCC_spec Session("SID"), _
rsSelect
Anyways, just to ferify whether your code is at fault, run the following:
dim arData
if not rsSelect.eof then
arData=rsSelect.getrows
end if
rsSelect.close: set rsSelect = nothing
dbConn.close: set dbConn = nothing
if isArray(arData) then
response.write "arData contains " & ubound(arData,2) & _
" rows<BR>"
else
response.write "arData contains zero rows<BR>"
end if
%>
If ardata contains the correct number of rows, then you need to peruse the
code used to generate the table html and verify that it is correctly
creating a new <tr> element when processing each record of the recordset,
and not simply overwriting the data in the initially created <tr> element.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"