session值莫名奇妙丢失

ziziszj 2008-05-26 11:08:40
<%sub listAffiche()

set rs=server.CreateObject("adodb.recordset")
sql="select * from hyjuankuan order by jzTime desc,id desc"
''创建对象
Set mypage=new xdownpage
''得到数据库连接
mypage.getconn=conn
''sql语句
mypage.getsql=sql
''设置每一页的记录条数据为5条
mypage.pagesize=20
''返回Recordset
set rs=mypage.getrs()
%>

<form action="" method="post" name="listAffiche">
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="1" style="BORDER-COLLAPSE: collapse">
<tr class="trTitle">
<td colspan="5">捐款管理</td>
</tr>
<tr class="tr2">
<td width="10%" height="35" align="center">编号</td>
<td width="40%" align="center">捐款人姓名</td>
<td width="15%" align="center">捐款金额</td>
<td width="25%" align="center">捐款时间</td>
<td width="10%" align="center">删除</td>
</tr>
<%
If not rs.eof then
for i=1 to mypage.pagesize%>
<tr class="tr1">
<td align="center"><%=rs("ID")%></td>
<td align="center"><%=rs("jzName")%></td>
<td align="center"><%=rs("jzMoney")%></td>
<td align="center"><%=rs("jzTime")%></td>
<td align="center"><a href="jk.asp?action=del&id=<%=rs("ID")%>" onClick='{if(confirm("确定删除吗?")){return true;}return false;}'>删除</a>|<a href="jk.asp?action=edit&id=<%=rs("ID")%>">编辑</a></td>
</tr>
<%

'=======打印设置===================================
dim printArray,printIndex
printIndex=i+1
redim printArray(21,4)
printArray(printIndex,1) = rs("ID")
printArray(printIndex,2) = rs("jzName")
printArray(printIndex,3) = rs("jzMoney")
printArray(printIndex,4) = rs("jzTime")
printArray(0,0) = printIndex
printArray(0,1) = now()
printArray(1,1) = "编号"
printArray(1,2) = "捐款人姓名"
printArray(1,3) = "捐款金额"
printArray(1,4) = "捐款时间"
Session("printArray") = printArray
rs.movenext
if rs.eof then exit For
response.write Session("printArray")(printIndex,1) & "|" & Session("printArray")(printIndex,2) & "\" & Session("printArray")(printIndex,3) & "/" & Session("printArray")(printIndex,4) & "<br>"
next
response.write Session("printArray")(2,1) & "?" & Session("printArray")(2,2) & "%" & Session("printArray")(2,3) & "&" & Session("printArray")(2,4) & "<br>"
end If
%>
<tr class="tr2">
<td colspan="6"><input name="button" type="button" onClick="location.href='jk.asp?action=add'" value="添加捐款信息">
<input name="button" type="button" onClick="outExcel('捐款信息');" value="导出EXCEL">
           </td>
</tr>
<tr align="right" class="tr2">
<td colspan="5">
<div align="right">分页导航:<% mypage.showpage()%></div> </td>
</tr>
</table>
</form>
<%end sub%>
结果response.write输出部分:
363|唐大春\30/2008-5-21
362|潘显荣\30/2008-5-21
361|胡光耀\30/2008-5-21
360|吴红峰\30/2008-5-21
359|俞仲基\30/2008-5-21
358|姚明德\30/2008-5-21
357|黄小珍\30/2008-5-21
356|应道有\30/2008-5-21
355|濮水良\30/2008-5-21
354|董绍兴\30/2008-5-21
353|吴素红\30/2008-5-21
352|俞红兵\30/2008-5-21
351|余津\30/2008-5-21
350|郭美科\30/2008-5-21
349|王庆红\30/2008-5-21
348|漆国富\30/2008-5-21
347|毛和明\30/2008-5-21
346|许凌\30/2008-5-21
345|吴菊华\30/2008-5-21
344|黄久洪\30/2008-5-21
|\/
为什么到了next后面输出的结果却是空的呢??session的值是怎么丢失了??
...全文
82 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ziziszj 2008-05-26
  • 打赏
  • 举报
回复
输出结果是这样的,上面那个错了。
363 ¦唐大春\30/2008-5-21
362 ¦潘显荣\30/2008-5-21
361 ¦胡光耀\30/2008-5-21
360 ¦吴红峰\30/2008-5-21
359 ¦俞仲基\30/2008-5-21
358 ¦姚明德\30/2008-5-21
357 ¦黄小珍\30/2008-5-21
356 ¦应道有\30/2008-5-21
355 ¦濮水良\30/2008-5-21
354 ¦董绍兴\30/2008-5-21
353 ¦吴素红\30/2008-5-21
352 ¦俞红兵\30/2008-5-21
351 ¦余津\30/2008-5-21
350 ¦郭美科\30/2008-5-21
349 ¦王庆红\30/2008-5-21
348 ¦漆国富\30/2008-5-21
347 ¦毛和明\30/2008-5-21
346 ¦许凌\30/2008-5-21
345 ¦吴菊华\30/2008-5-21
344 ¦黄久洪\30/2008-5-21
?%&
ld2099 2008-05-26
  • 打赏
  • 举报
回复
确认没有传值的话,看看IIS是不是多线程
wdbjsh 2008-05-26
  • 打赏
  • 举报
回复
我看的资料里面有的说能用数组有的说不能用数组,我手头没有iis没法做测试


如果能用的话下面这段代码应该可用
For iLoop = LBound(Session(strName)) to UBound(Session(strName))
Response.Write strName & "(" & iLoop & ") - " & _
Session(strName)(iLoop) & "<BR>"
Next
wdbjsh 2008-05-26
  • 打赏
  • 举报
回复
实话说,从来没有给session设置过array类型的值。。。。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧