当前位置: 代码迷 >> ASP >> 查询了10条,只显示2条,该如何处理
  详细解决方案

查询了10条,只显示2条,该如何处理

热度:84   发布时间:2012-03-28 15:40:03.0
查询了10条,只显示2条
dim sql_g,rs_g,flag,col,arrsub,i
sql_g = "select Distinct TOP 10 id,name from tender order by id desc"
set rs_g = connent.execute(sql_g)
arrsub = rs_g.getrows(10)
for i = 0 to ubound(arrsub) step 1
  '这里是输出
next



代码如上 数据库里面也有10条以上的数据 但是显示的时候只有2条


大虾、小虾们 帮忙看看啥原因

------解决方案--------------------
arrsub = rs_g.getrows(10)
responese.write " <br>ubound(arrsub) ="& ubound(arrsub)
for i = 0 to ubound(arrsub) step 1
'这里是输出
next
------解决方案--------------------
二维数组要用ubound(arrsub,2)
VBScript code

...
for i = 0 to ubound(arrsub,2)
   response.write arrsub(0, i)
   response.write arrsub(1, i)
...
next 
  相关解决方案