我怎么知道我是否在记录集的最后一条记录上.我的循环如下; %do while (adoRsTrade.AbsolutePage = iPageCurrent) and (not adoRsTrade.EOF)NewRep = adoRsTrade("calIncludedRep")% 我之间有很多代码但是这个if语句才
<%do while (adoRsTrade.AbsolutePage = iPageCurrent) and (not adoRsTrade.EOF) NewRep = adoRsTrade("calIncludedRep")%>
我之间有很多代码但是这个if语句才是重要的,只要CurRep<>,它就会显示正在呈现的数据的小计. NewRep意味着现在是下一个人数据集
if (CurRep <> NewRep or FirstTime="T" and (not adorsTrade.BOF)) then If FirstTime <> "T" then%> <TR> <td> <table class='FontStandardMinus1' border=0 cellPadding=0 align='left' cellSpacing=0 width="100%" bgcolor='#ffffff'> <TR> <td width="59%" align="left"><b>SubTotals<!-- for <%Response.Write(CurRep) %>-->:</b></td> <td width="10%" valign=top align=right><%=FormatNumber(totPrincipal,2)%></td> <td width="7%" valign=top align=right><%=FormatNumber(totInterest,2)%></td> <td width="7%" valign=top align=right><%=FormatNumber(totCommission,2)%></td> <td width="5%" valign=top align=right><%=FormatNumber(totSECFee,2)%></td> <td width="4%" valign=top align=right><%=FormatNumber(totSvcFee,2)%></td> <td width="9%" valign=top align=right><%=FormatNumber(totNet,2)%></td> </TR> </table> </td> </TR> <%end if%>
基本上我需要另一个条件,如果currep<> newrep或firsttime =“t”
或者,如果它是ADO Recordset中的最后一条记录,则显示这也是一个小计.
<% FirstTime="F" CurRep = adoRsTrade("calIncludedRep") adoRsTrade.MoveNext loop%>
任何帮助是极大的赞赏,
先感谢您,
NickG
例如:
Do While adoRsTrade.AbsolutePage = iPageCurrent And Not adoRsTrade.EOF ' DO SOME STUFF ' -------------- ' -------------- adoRsTrade.MoveNext If adoRsTrade.EOF Then ' last record! ' DO SOME OTHER STUFF End If Loop