注册 登录
编程论坛 ASP技术论坛

asp 自动排序问题

发布于 2010-04-27 01:08, 417 次点击
我按一定要求搜索出一些商品,怎么样让他们一个个自动标出行号呢?

=================================================================以下是我的代码:

<table width="100%"  border="1" cellspacing="0" bordercolor="#000000">
  <tr bordercolor="#000000">
    <%
drss.movenext
III=III+1
loop
 end if
%>
    <td width="5%"><div align="center"><b>行号</b></div></td>
    <td width="23%"><div align="center"><strong>商品全称</strong></div></td>
  </tr>
  <% If Request.QueryString("CurPage")="" or Request.QueryString("CurPage")=0 then
CurPage = 1
Else
CurPage = CINT(Request.QueryString("CurPage"))
End If

if lid<>"" then
souselect=souselect&" and y_lei="&lid&""
end if
if tt<>"" then
souselect=souselect&" and y_zhuangtai="&int(tt)&""
end if
if request("souname")<>"" then
souselect=souselect&"and (y_zhuti like '%"&request("souname")&"%' or y_user like '%"&request("souname")&"%' or y_bjie like '%"&request("souname")&"%'  or y_user_kehu like '%"&request("souname")&"%')"
end if
set drs= Server.CreateObject("adodb.recordset")
drs.open ("select * from nnt_yewu "&souselect&" "&selectquan&" order by y_stime desc "),conn,1,1

if drs.eof then
                  Response.Write("<tr><td colspan=6>该公司今日无任何已 完成 业务,请查询后再打印。</td></tr>")
                  else
                  
                  dRS.PageSize=20
    Dim TotalPages   
    TotalPages = dRS.PageCount   
   
    If CurPage>dRS.Pagecount Then     
        CurPage=dRS.Pagecount   
    end if
   
    dRS.AbsolutePage=CurPage   
   
    drs.CacheSize = dRS.PageSize   
     
    Dim y_bjie
    y_bjie=split(drs("y_bjie"),"|@|")
   
   
    Dim Totalcount   
    Totalcount =INT(dRS.recordcount)
    do while (Not dRS.Eof) and (II<dRS.PageSize)
    y_user_kehu=split(drs("y_user_kehu"),"||")
 %>
  <tr bordercolor="#000000"  onmouseover="javascript:bgColor='#C8E4FF'" onmouseout="javascript:bgColor='#ffffff'">
    <td height="18" align="center">1</td>
    <td><div align="center"><%= drs("y_zhuti") %> </div></td>
  </tr>
</table>

4 回复
#2
2010-04-27 01:09
希望得到大侠的帮助,谢谢了。。
#3
2010-04-27 09:48
可以这么排序么?
#4
2010-04-27 14:16
人呢?
#5
yms1232010-04-28 16:06
'recno=(page-1)*rsano.pagesize+ipage记录编号计算公式
分页求记录编号的算法
1