3
내가 레코드 집합의 마지막 레코드에 있는지 어떻게 알 수 있습니까? 내 루프는 다음과 같습니다.ADO 레코드의 마지막 레코드에 있는지 어떻게 확인합니까?
<%do while (adoRsTrade.AbsolutePage = iPageCurrent) and (not adoRsTrade.EOF)
NewRep = adoRsTrade("calIncludedRep")%>
내가 사이에 코드를 많이 가지고 있지만이 문은 다음 사람이 설정에 지금은 데이터의 합계는 즉 의미 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" OR는 ADO 레코드의 마지막 레코드 인 경우에 다음이뿐만 아니라 소계입니다 표시합니다.
<%
FirstTime="F"
CurRep = adoRsTrade("calIncludedRep")
adoRsTrade.MoveNext
loop%>
어떤 도움이 크게 감사합니다, 당신이 마지막 레코드에있는 경우 테스트하기 위해 레코드에 MoveNext를 호출 한 후에는 EOF를 확인할 수 있습니다, 사전에 NickG
당신은 RecordCountin에게 변수를 저장할 수'rsCount = AdorsTrade.RecordCount' (사용하는 것을 잊지 마세요'adodb.CursorLocation = 3') 후 간단한 변수와 비교 당신은 루프에서 증가했다 ('aktCount = aktCount + 1'). 'rsCount = aktCount Then'과 같은 것입니다. – stare