考虑一个包含四行的记录集,如下所示
Team NumDocs
OPS10 2
OPS4 1
OPS5 2
OPS7 3
还要考虑表格中的以下行来显示这些。
<td>
<% If Trim(RS("Team")) = "OPS1" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS10" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS2" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS3" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS4" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS5" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS6" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS7" And not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS8" And Not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
<td>
<% If Trim(RS("Team")) = "OPS9" And Not RS.EOF Then
Response.Write(RS("NumDocs"))
RS.MoveNext
End If%>
</td>
标题行包含 10 个硬编码标题,OPS1、OPS10、OPS2 等。
上面填充 OPS7 列的部分很好,“2”的值被写入单元格。然后我在 OPS8 的下一列中收到错误 - 显然没有返回值,因为它只上升到 OPS7。这就是我在 IF 语句中放置 Not EOF 的原因,但我仍然收到错误消息。
有人可以帮忙吗?