title: Dynamic Select Option in Classic ASP
body: <p>I'm trying to write this code in Classic ASP but I can't get it to work for some reasons. Maybe I'm missing something:</p>
  
  <pre><code>        &lt;select name="reseller" /&gt;
          &lt;option value=""&gt;Select a Reseller:&lt;/option&gt;
          &lt;%
          sql = "SELECT resellerid, company FROM resellers WHERE insidesales &lt;&gt; 'True' ORDER BY company ASC"
          set rsResellers=conn.execute(sql)
              do until rsResellers.eof
                  thisReseller = rsResellers("company")
                  if strReseller = thisReseller then thisSEL = " SELECTED='SELECTED'" else thisSEL = "" end if
                  response.write "&lt;option value="""&amp; rsResellers("company") &amp;""""&amp; thisSEL &amp;"&gt;"&amp; rsResellers("company") &amp;"&lt;/option&gt;"
              rsResellers.movenext
              loop
          rsResellers.close
          set rsResellers=nothing
          %&gt;
          &lt;/select&gt;
  </code></pre>
  
  <p>strReseller comes a query: strReseller = rsRMA("reseller"). If I do a response.write strReseller, I get a value, so I know the string isn't empty. But for some reasons, the option isn't "SELECTED". </p>
  
  <p>I know I should be using "resellerid" but for this particular project, I can't since I'm taking over an old database with data in it, and the data doesn't use the ID.</p>