programming-examples/asp/Data_Access_DateTime/Dynamic Dropdown Boxes.asp

25 lines
642 B
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<select size="1" name="LocationCode">
<option selected><%=LocationCode%></option>
<%
On Error Resume Next
SET GENERAL = Server.CreateObject("ADODB.Recordset")
GENERAL.ActiveConnection = "DSN=ODBC NAME" or connection string of choice
GENERAL.Source = "Select DESCRIPTION From DESCRIPTION Order By DESCRIPTION"
GENERAL.CursorType = 0
GENERAL.LockType = 3
GENERAL.Open
GENERAL_numRows = 0
Do until GENERAL.EOF = True
response.write "<option>" & trim(GENERAL.Fields.Item("DESCRIPTION").value) & "</option>"
GENERAL.Movenext
Loop
GENERAL.Close
Set General = Nothing
response.write "<option>OTHER</option>"
%>
</select>