Hello
I'm using the following to populate a drop down list with distinct values from three fields in a SQL database:
<select name="subArea" class="Text">
<option value="" selected></option>
<%
SELECTStmt = "SELECT DISTINCT subjectName,confSubjectArea2,confSubjectArea3 AS t1 "
FROMStmt = "FROM JPL_conf_DetailsView "
ORDERStmt = "ORDER BY t1 "
SQLStmt = SELECTStmt & FROMStmt & ORDERStmt
Set RS = Connection.Execute(SQLStmt)
Do While Not RS.EOF
cfSubject = RS.Fields("t1")
response.write("<option value='" & cfSubject & "'>" & cfSubject & "</option>" & vbCrLf)
RS.MoveNext
Loop
RS.close
%>
</select>
However, this only returns the following:
<select name="subArea" class="Text">
<option value="" selected></option>
<option value=''></option>
<option value=''></option>
<option value=''></option>
<option value=''></option>
<option value=''></option>
<option value=''></option>
<option value=''></option>
<option value=''></option>
<option value='Children (Private Law)'>Children (Private Law)</option>
</select>
It only seems to retrieve the very last value it finds. I'm not sure where I'm going wrong here - any help would be much appreciated.
Thanks