循环语句的时候两列循环怎么写

来源:百度知道 编辑:UC知道 时间:2024/06/04 10:47:41
rs.open "select * from info where tid="&ttid&" order by date desc",conn,1,1
if rs.eof then
Txnew2="·暂无还没有文章"
else
do while not rs.eof
h=h+1
Txnew2=Txnew2&"<table><tr><td width=212 height=15>·<a href=""../info/"&rs("id")&"-1.htm"" target=_blank><font size=2>"&Mid(rs("title"),1,15)&"</font></a></td>"

h=h+1
Txnew2=Txnew2&"<td width=212 height=15>·<a href=""../info/"&rs("id")&"-1.htm"" target=_blank><font size=2>"&Mid(rs("title"),1,15)&"</font></a></td></tr></table>"
if h>=16 then exit do
rs.movenext
loop
h=0
end if
rs.close
这是我写的.是显示出了两列一样的文章,请问怎么改进

rs.open "select * from info where tid="&ttid&" order by date desc",conn,1,1
if rs.eof then
Txnew2="·暂无还没有文章"
else
Txnew2="<table><tr>"
do while not rs.eof
h=h+1
Txnew2=Txnew2&"<td width=212 height=15>·<a href=""../info/"&rs("id")&"-1.htm"" target=_blank><font size=2>"&Mid(rs("title"),1,15)&"</font></a></td>"
ifh mod 2 = 0 then
Txnew2=Txnew2&"</tr><tr>"
end if
if h>=16 then exit do
rs.movenext
loop
Txnew2=Txnew2&"</tr></table>"
h=0
end if
rs.close