当我只使用以下一段代码时,我的代码运行良好,但是当我添加另一段时,它的结果没有显示出来。当 EOF 在同一页面上运行两次时,它似乎无法工作。如果有人可以提供帮助,将不胜感激。
<% while (NOT con.EOF) %>
CODE HERE
<%con.MoveNext()
Wend %>
代码:
<% if not con.BOF then %>
<div style="margin-top:1em">
<form action="dbresults.htm" method="get">
<p>Company name:<br/>
<select name="abn">
<option label="All companies" value="all"></option>
<% while (NOT con.EOF) %>
<option label="<%=con("legal")%>" value="<%=con("abn")%>"></option>
<%con.MoveNext()
Wend %>
</select>
</p>
<p>Categories for Creative Design:<br/>
<select name="cat">
<option label="All categories" value="all"></option>
<option label="Strategic brand, marketing and communications advice" value="a"></option>
<option label="Graphic design and layout" value="b"></option>
<option label="Forms design" value="c"></option>
<option label="Web design and development" value="d"></option>
<option label="Authoring services" value="e"></option>
<option label="Editorial services" value="f"></option>
<option label="Translation services" value="g"></option>
<option label="Photography and film services" value="h"></option>
<option label="Scanning and digitisation services" value="i"></option>
<option label="Multimedia editing services" value="j"></option>
</select>
</p>
<input type="submit" value="Search" />
</form>
<br /><hr />
<table style="font-size:.9em;" class="contentTable">
<tr>
<th>ABN:</th>
<th>Company Name:</td>
</tr>
<% while (NOT con.EOF) %>
<tr>
<td><%=con("abn")%></th>
<td><a href="dbcomp.htm?abn=<%=con("abn")%>&cat=all">
<%=con("legal")%></a></td>
</tr>
<%
con.MoveNext()
Wend
%>
</table>
</div>
<% else %>
<p>No records match your query.</p>
<p><a href="dbtest.htm">Return to search page</a></p>
<%
end if
con.close
%>