<%@ LANGUAGE="VBSCRIPT" %>

<%
    Set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.Open "MSStore"
    SQL = "SELECT Category.CategoryID, Category.CategoryName FROM 
           Category WHERE CategoryId in (SELECT categoryID FROM product) 
           ORDER BY CategoryName;"
    Set rsCategories = dbConn.Execute(SQL)
%>

....

    <% 
        Do until rsCategories.EOF
    %>
    
    <option value=<%=rsCategories.Fields("CategoryId")%>><%=rsCategories.Fields("CategoryName")%>

    <%
        rsCategories.MoveNext
        Loop
    %>