+ -
当前位置:首页 → 问答吧 → 请高手帮解决,asp多行多列显示分数!

请高手帮解决,asp多行多列显示分数!

时间:2011-06-28

来源:互联网


想把数据表中的数据,显示出来(多行多列)。
行为专家姓名,列为公司名称,数据为对应的评分。
单独运行查询,结果都正确,但再加入个循环,结果就不对,只显示第一组分数。
调试多次,不知错误在哪里?
请专家们帮我分析一下

<tr>
<td width="15%" height="30">公司名称(代号)</td>
<td width="10%">&nbsp;</td>
<td>&nbsp;</td>
<td width="5%" align="center"> </td>
<% do while not rscompyScre.eof %>
<td align="center"><%=rscompyScre("company")%></td>
<%
compIdArr(i)=rscompyScre("compID")
rscompyScre.movenext
i = i + 1
loop 
%>
</tr>
 <%
set rst=rsfun("SELECT zhu.expertid, bao.id, bao.fen, ex.ena1, bao.biaoid, bao.zhuid FROM huizong where id=" & baoID,1)
rscompyScre.movefirst
rst.movefirst
do while not rst.eof 
%>
'查询专家名

<%
  set rs=rsfun("SELECT score, ena1 FROM fen, toubiaorecord AS tou, expert AS e WHERE e.id=fen.eid and fen.touid=tou.ids and eid="&rst("expertid")&" and companyid="&rscompyScre("compID")&" and bid=" & baoID,1)
do while not rs.eof 
%>
’查询专家名和公司名对应的分数  
<tr>
<td height="25">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td align="center"><%=rs("ena1")%></td>
  <% for i = 1 to compNum %>
<td align="center"> <%=rs("score")%></td>
  <% next %>
  </tr>
<%
rs.movenext
loop
rst.movenext
loop
%>  
  <%
rs.close
set rs=nothing
rst.close
set rst=nothing
%>  
<%
end if
%> 
<tr>

作者: giantjian   发布时间: 2011-06-28

<% 
compIdArr(i)=rscompyScre("compID")
rscompyScre.movenext
i = i + 1
loop  
%>
</tr>
 <%
set rst=rsfun("SELECT zhu.expertid, bao.id, bao.fen, ex.ena1, bao.biaoid, bao.zhuid FROM huizong where id=" & baoID,1)
rscompyScre.movefirst
rst.movefirst
do while not rst.eof  
%>

问题可能在这两个movefirst上。。注释掉调试下看看

作者: aspwebchh   发布时间: 2011-06-28

我试过,不是这个错误,我感觉还是循环结构有问题?

作者: giantjian   发布时间: 2011-06-28