Unique combo box sample
Here is the code for this Example <%@ Language=VBScript %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <title>Unique combo box sample</title> <BODY> <!-- Author: Adrian Forbes --> <% set objRS = createobject("ADODB.Recordset") objRS.Open "select strParent from Parent", strconn set objDic = CreateObject("Scripting.Dictionary") while not objRS.EOF sString = cStr(objRS("strParent")) if not objdic.Exists (sString) then objDic.Add sString, sString end if objRS.MoveNext wend objRS.Close set objRS.ActiveConnection = nothing set objRS = nothing %> <form name=frmTest action="TwoComboDatabase.asp" method=POST> <p> <select name=cboPrimary size=1> <% aResults = objDic.Items for i = 0 to objDic.Count - 1%> <option><%=aResults(i)%> <%next objDic.RemoveAll set objDic = nothing %> </select> </p> </form> </BODY> </HTML> |