求解ASP代码

来源:百度知道 编辑:UC知道 时间:2024/06/25 20:38:24
<%
set rscl2=server.CreateObject("adodb.recordset")
str="select * from [column2] where column1="&rscl1("c1id") &" order by ord Asc"
rscl2.open str,db,1,1
i=0
do while not rscl2.eof
i=i+1 =====从这里开始晕了
if (i mod 2)=1 then
%>
<td width="80" height="20" align="center"><a href="leibie.asp?column1=<%=rscl1("c1id")%>&column2=<%=rscl2("c2id")%>"><%=rscl2("column2")%></a></td>
<td width="20" align="center">|</td>
<%
end if
if (i mod 2)=0 then%>
<td width="80" align="center"><a href="leibie.asp?column1=<%=rscl1("c1id")%>&column2=<%=rscl2("c2id")%>"><%=rscl2("column2")%></a></td>

其实简单,这个就是判断第几行几列的输出

以i作为变量初始值
if i=rscl2.recordcount and (i mod 2)=1 then
这个为当i等于rscl2这个查询的记录数总和并且i mod 2=1 同时存在时,跳到下个表格。
仔细看,并把程序看懂,就知道了
你这边代码还不全,还有个rscl1变量的使用组件呢

加我,我给你讲
576602201