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

现在是选择前两个 我想直接从 第三个开始 怎么写呀 那位老大帮一下忙 谢谢

jifengsm 发布于 2011-03-10 13:10, 778 次点击
<%
   dim sqlsort1,RsSort1,hangpicnum1
   sqlsort1="select top 2 * from Sort where B_id=0 and setting < 4 and Indexshow=True order by S_order"
   Set RsSort1=conn.execute (sqlsort1)
   RsSort.Open sql,Conn,1,1
   Response.Write"<table border='0' cellspacing='0'>"
   if RsSort1.eof and RsSort1.bof then
   response.write "<div align=center>还没有任何栏目</div>"
   else
   response.write"<tr>"
   do while not rs.eof
   for hangpicnum1=1 to 2
   if RsSort1.eof then exit for
   Response.Write"<td>"
%>


现在是选择前两个  我想直接从 第三个开始 怎么写呀    那位老大帮一下忙 谢谢
7 回复
#2
sky2222011-03-10 13:36
能说具体点吗。,不明白啥意思
#3
tandezhong2011-03-10 14:08
回复 楼主 jifengsm
for i=1 to rs.recordcount
 if i>6 and i<12 then
        %>
      <table width="100%" height="28" border="0" cellpadding="0" cellspacing="0" style="border-bottom:#CCCCCC 1px dotted;">
        <tr>
          <td width="19%" align="center"><img src="images/jt_03.gif" width="9" height="9" /></td>
          <td width="81%" class="txt_07"><a href="?cid=<%=rs("id")%>"><%=rs("ComName")%></a></td>
        </tr>
      </table>
       <% end if%>
        <% rs.movenext%>
       <% if rs.eof then exit for %>
      <%next%>
这是从第七条读...
#4
jifengsm2011-03-10 14:31
我那个怎么修改能从第三个开始呀
#5
hams2011-03-10 14:42
<%
   dim sqlsort1,RsSort1,hangpicnum1
   sqlsort1="select * from Sort where B_id=0 and setting < 4 and Indexshow=True order by S_order"
   Set RsSort1=conn.execute (sqlsort1)
   RsSort1.Open sql,Conn,1,1
   Response.Write"<table border='0' cellspacing='0'>"
   if RsSort1.eof and RsSort1.bof then
   response.write "<div align=center>还没有任何栏目</div>"
   else
   response.write"<tr>"
RsSort1.movenext
RsSort1.movenext
   do while not RsSort1.eof
   for hangpicnum1=1 to 2
   if RsSort1.eof then exit for
   Response.Write"<td>"
%>



[ 本帖最后由 hams 于 2011-3-11 08:11 编辑 ]
#6
jifengsm2011-03-10 15:23
老大你这个是 显示前几个 前两个都显示了   我不想显示前两个  是要从第三个开始显示呀  谢谢了
#7
hams2011-03-11 08:12
没仔细看,你原来的代码用的变量前后都不一样的,看样子是东拼西凑别人的代码。

<%
   dim sqlsort1,RsSort1,hangpicnum1
   sqlsort1="select * from Sort where B_id=0 and setting < 4 and Indexshow=True order by S_order"
   Set RsSort1=conn.execute (sqlsort1)
   RsSort1.Open sql,Conn,1,1
   Response.Write"<table border='0' cellspacing='0'>"
   if RsSort1.eof and RsSort1.bof then
   response.write "<div align=center>还没有任何栏目</div>"
   else
   response.write"<tr>"
RsSort1.movenext
RsSort1.movenext
   do while not RsSort1.eof
   for hangpicnum1=1 to 2
   if RsSort1.eof then exit for
   Response.Write"<td>"
%>
#8
jifengsm2011-03-11 08:50
好使了 非常感谢老大
1