This asp page designed with nested tables, and have images in the center which made is very hard to populate data from database without mess up the table layout! I have to put my data inside 2 <TD> . ,TD>1 and <TD>3 is data <TD>3 is image.
I have to calculate the number of the record and divide them evenly across the <TD>. For this purpose, I choose Getrows method to divide the number /2. this is work if the record is even, but not working correctly if the record is odd. Sometime I miss the last record and have duplicated record of the one before the last.
set rstGetRows = db.execute(sql)
arrDBData = rstGetRows.GetRows
iRecFirst = LBOUND(arrDBData,2)
iRecLast = UBOUND(arrDBData,2)
iFieldFirst = LBOUND(arrDBData,1)
iFieldlAST = UBOUND(arrDBData,1)
SET rstGetRows = NOTHING
SET DB = NOTHING
tablefill = (IrEClAST + 1)/2
FOR i = IrECfIRST TO tablefill
response.write "<tr align=right><td><a href='getarticle.asp?articleid=" & arrDBData(J ,I) & "'>" & arrDBData(J+1,I)
response.write " - " & arrDBData(J +4,I) &"</a></td></tr>"
<TD>fixed flash object</td>
FOR i = tablefill TO IrEClAST
response.write "<a href='getarticle.asp?articleid=" & arrDBData(J ,I) & "'>" & arrDBData(J+1,I)
response.write " - " & arrDBData(J +4,I) &"<br>"