asp循环行数输出函数_ASP教程-查字典教程网
asp循环行数输出函数
asp循环行数输出函数
发布时间:2016-12-29 来源:查字典编辑
摘要:经过大鸟哥的指导已做全面的修改,本人能力有限只能做到下面这步了:ASP/VisualBasic代码复制代码代码如下:pthenexitdor...

经过大鸟哥的指导已做全面的修改,本人能力有限只能做到下面这步了:

ASP/VisualBasic代码

复制代码 代码如下:

<%

Constp=6'每页2条

setrs=server.createobject("adodb.recordset")

sql="Select*fromshoworderbyidDesc"

rs.Opensql,conn,1

i=0

dowhilenotrs.eof

%><tdalign="center"height="98">

<ahref="show.asp?id=<%=rs("id")%>">

<imgsrc="<%=rs("pic")%>"width="150"height="98"alt="<%=rs("name")%>"/></a>

</td>

<%

If(i+1)Mod3=0Then

Response.Write"</tr>"

Ifi<(p-1)ThenResponse.Write"<tr>"

EndIf

i=i+1

ifi>pthenexitdo

rs.movenext

Loop

IfiMod3<>0Then

Form=3-(iMod3)To1Step-1

response.write"<td></td>"

Next

response.write"</tr>"

EndIf

Ifi=3Then

response.write"<td></td><td></td><td></td></tr>"

Endif

rs.close

setrs=nothing

%>

之前的代码未更改

复制代码 代码如下:

<%

Constp=6'每页2条

setrs=server.createobject("adodb.recordset")

sql="Select*fromshoworderbyidDesc"

rs.Opensql,conn,1

i=1

dowhilenotrs.eof

%><tdalign="center"height="98">

<ahref="show.asp?id=<%=rs("id")%>">

<imgsrc="<%=rs("pic")%>"width="150"height="98"alt="<%=rs("name")%>"/></a>

</td>

<%

ifimod3=0then

Response.Write("</tr><tr>")

endif

i=i+1

ifi>pthenexitdo

rs.movenext

Loop

rs.close

setrs=nothing

%>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新ASP教程学习
    热门ASP教程学习
    编程开发子分类