**********紧急求助,原本一行显示一件商品,我想改成一行显示四件商品
请高手们帮帮忙,指点下吧,我用其它代码做参考研究过,但没搞掂
代码如下:
Sql= "select * from Sales where BigTypeID= "&BigTypeID& " order by id desc "
set rs=server.createobject( "ADODB.Recordset ")
rs.open sql,conn,1,1
If rs.eof then
MainCode=MainCode & " <tr> <td width= " "100% " " height= " "45px " "align= " "center " "> 对不起! 本分类的商品正在整理资料! </td> </tr> "
Mpage=1
Allshu=0
Else
Rs.pagesize=PageSum '得到每页数
Mpage=Rs.PageCount '得到总页数
Rs.Move (CurrentPage-1)*PageSum
Allshu=Rs.Recordcount
H=0
do while not rs.eof
Product=rs( "Product ")
BigTypeID=rs( "BigTypeID ")
BrandID=rs( "BrandID ")
PriceA=rs( "PriceA ")
PriceB=rs( "PriceB ")
ProductID=rs( "ProductID ")
Sign=rs( "Sign ")
GuiGe=rs( "GuiGe ")
Capa=rs( "Capa ")
IfNoSale=rs( "IfNoSale ")
IfXia=rs( "IfXia ")
If IfXia=1 then BuyCar= " <Img src= " "/Image/Icon_QueHuo.Gif " " border= " "0 " " align= " "absmiddle " "> "
If IfNoSale=1 then BuyCar= " <Img src= " "/Image/Icon_ZengPin.Gif " " border= " "0 " " align= " "absmiddle " "> "
If IfNoSale=0 and IfXia=0 then BuyCar= " <a href= " "/AddBuy.Asp?SalesID= "&rs( "ID ")& " " "> <Img src= " "/Image/Icon_BuyCar.Gif " " border= " "0 " " align= " "absmiddle " "> </a> "
sqlp= "select * from Product where ID= "&ProductID& " order by ID desc "
set rsp=server.createobject( "ADODB.Recordset ")
rsp.open sqlp,conn,1,1
Pics=rsp( "Pics ")
Unit=rsp( "Unit ")
if Pics= " " then
Pics= " <img src= " "../ProductPic/NoPics.jpg " " width=100 height=100 border= " "0 " " alt= " " "&Brand& " "&Product& " " "> "
else
Pics= " <img src= " "../ProductPic/ " & Pics & " " " width=100 height=100 border= " "0 " " alt= " " "&Brand& " "&Product& " " "> "
end if
rsp.close
set rsp=nothing
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td align= " "center " "> " & vbCrLf
MainCode=MainCode & " <table border= " "0 " " width= " "110px " " cellspacing= " "0 " " cellpadding= " "0 " "> " & vbCrLf
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td height= " "6 " "> </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td width= " "18% " "> <div align= " "center " "> <a href= " "/Product/Product "&BigTypeID& " "&ProductID& ".Asp " " target= " "_blank " "> "&Pics& " </a> </div> </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td height= " "20 " "> <div align= " "center " "> <input type= " "checkbox " " value= " " "&rs( "ID ")& " " " name= " "BiJiao " "> </div> </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td height= " "20 " "> <div align= " "center " "> <a href= " "/Product/Product "&BigTypeID& " "&ProductID& ".Asp " " target= " "_blank " " title= " " "&Brand& " "&Product& " " "> "&left(trim(Rs( "Product ")),8)& " </a> </div> </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td height= " "20 " "> <div align= " "center " "> 会员价: <b> "&PriceB& " </b> 元 </div> </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " <tr> " & vbCrLf
MainCode=MainCode & " <td height= " "28 " "> <div align= " "center " "> "&BuyCar& " </div> </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " </table> " & vbCrLf
MainCode=MainCode & " </td> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
MainCode=MainCode & " </tr> " & vbCrLf
H=H+1
if H> =PageSum then exit do
rs.movenext
loop
End if
rs.close
set rs=nothing
MainCode=MainCode & " </form> </table> " & vbCrLf
[解决办法]
用 <td> 实现
比如:if i =4 then
response.write " </tr> <tr> "
i=1
end if
当然i在循环中要自增的