TomBarrand
Programmer
I want to populate a list box with values from a column in a table. At the momment it just lists every value, so I get duplicates. How can I stop duplicates occurring. Some of my current code is below.
Thanks,
<%
Dim oRSs
Set oRSs=Server.CreateObject ("ADODB.Recordset"
oRSs.Open "table_name", "DSN=dsnname;uid=;pwd="
oRSs.MoveFirst
%>
<form method="post" ACTION="SOResults.asp">
<P><select name="Salesperson" size="1">
<%
Do while not oRSs.eof
Response.Write "<option value='" & oRSs ("salesRep" & "'>"
Response.Write oRSs ("salesRep"
Response.Write "</option>"
oRSs.MoveNext
Loop
oRSs.Close
Set oRSs=nothing
%>
Thanks,
<%
Dim oRSs
Set oRSs=Server.CreateObject ("ADODB.Recordset"
oRSs.Open "table_name", "DSN=dsnname;uid=;pwd="
oRSs.MoveFirst
%>
<form method="post" ACTION="SOResults.asp">
<P><select name="Salesperson" size="1">
<%
Do while not oRSs.eof
Response.Write "<option value='" & oRSs ("salesRep" & "'>"
Response.Write oRSs ("salesRep"
Response.Write "</option>"
oRSs.MoveNext
Loop
oRSs.Close
Set oRSs=nothing
%>