아래 코드 중 하나만 사용하면 코드가 제대로 작동하지만 다른 코드를 추가 할 때 결과가 표시되지 않았습니다. 같은 페이지에서 두 번 실행하면 EOF가 작동하지 않는 것 같습니다. 누군가가 도울 수 있으면, 그것은 인정 될 것입니다.ASP 파일에서 두 번 EOF가 작동하지 않습니다.
<% while (NOT con.EOF) %>
CODE HERE
<%con.MoveNext()
Wend %>
CODE : 당신이 동일한 레코드를 반복하려는 경우 첫 번째 루프를 완료 한 후
<% 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
%>
첫 번째'while' 루프 다음에'con' 오브젝트를 되감습니까? 그렇지 않은 경우에도 파일의 끝에 앉아 있습니다. –
어떻게 그럴 수 있습니까? – sephiith
잘 모르겠습니다. 당신은'con' 객체가 어떤 타입인지를 지정하지 않았다. :) –