<% ' Copyright (C) 1998-2005 Cyberstrong Internet Services, Inc. All Rights Reserved ' ' This file has been seeded with unique information at point of sale and ' is traceable to its purchaser. ' ' Your license agreement forbids the removal of this notice. ' Country.asp - Country and state drop down boxes. ' CountryDDB() - Generate country drop down box ... Public Sub CountryDDB(ByVal argFieldName, ByVal argListType) Dim Selected, Country Dim CountryList : ReDim CountryList(0) ' NOTE: argListType is reserved for future use. Selected = Trim(UCase(GetFieldData(argFieldName, ""))) If (Selected = "") Then Selected = cstOriginCountry End If Call OrderLocationList("Countries", "Name", "", CountryList) wl("") End Sub ' StateDDB() - Generate state drop down box ... Public Sub StateDDB(ByVal argFieldName, ByVal argDefault) Dim Selected, State, TokenList Dim StateList : ReDim StateList(0) Selected = Trim(UCase(GetFieldData(argFieldName, argDefault))) Call OrderLocationList("ShippingRegions", "StateName", "StateCode", StateList) wl("") End Sub ' OrderLocationList() - Move "Other-Not Shown" to end of list for subsequent user selection ... Public Sub OrderLocationList(ByVal argTableName, ByVal argFieldName1, ByVal argFieldName2, ByRef argList) Dim rs, SQL, i, Other Set rs = Server.CreateObject("ADODB.Recordset") SQL = "SELECT * FROM " & argTableName & " ORDER BY " & argFieldName1 rs.Open SQL, Conn, adOpenKeyset, adLockOptimistic ReDim Preserve argList(rs.RecordCount - 1) i = 0 : Other = "" Do While (Not rs.EOF) If (Trim(UCase(Left(rs(argFieldName1), 5))) <> "OTHER") Then If (argFieldName2 <> "") Then argList(i) = Trim(rs(argFieldName1)) & "~" & Trim(rs(argFieldName2)) Else argList(i) = Trim(rs(argFieldName1)) End If i = i + 1 Else Other = Trim(rs(argFieldName1)) End If rs.MoveNext Loop rs.Close : Set rs = Nothing If (Other <> "") Then argList(i) = IIF(argFieldName2 = "", Other, Other & "~ZZ") End If End Sub %>