How do i check if i'm on the last record of an ADO Recordset?

dylan962

New Member
how do i know if i'm on the last record of the recordset. my loop is as follows;\[code\]<%do while (adoRsTrade.AbsolutePage = iPageCurrent) and (not adoRsTrade.EOF)NewRep = adoRsTrade("calIncludedRep")%>\[/code\]i have a lot of code in between but this if statement is what matters, it displays subtotals of the data being presented as long as the CurRep <> NewRep which means that is is now onto the next persons set of data\[code\]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%>\[/code\]basically i need another condition that says if currep <> newrep or firsttime="t"OR if it's the last record in the ADO Recordset then display this is a subtotal as well.\[code\]<%FirstTime="F"CurRep = adoRsTrade("calIncludedRep")adoRsTrade.MoveNextloop%>\[/code\]any help is greatly appreciated,thank you in advance,NickG
 
Back
Top