All,
I've got two problems. The first problem is that I am trying to populate a listbox with values from a database, but without them repeating. I have 50 south and 50 north and would like the listbox to just list 1 south and 1 north. With the code that I have generated I get 50 south ano none of the north. Here is that piece of code:
Set objDC = Server.CreateObject("ADODB.Connection"
objDC.open("act1"
Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset"
rsGlobalWeb.Open "act1", objDC, Search
Search = "Select DISTINCT Criteria from act1"
If NOT rsGlobalWeb.BOF Then%>
<form method="Post">
<Select Name = "Criteria1">
<Option Selected>--Select Criteria--
(...)
Now, the second problem is I am trying to assign a variable to what fields will populate the listbox. So if the user chooses chapter, committee, or directors the listbox will be populated with the fields under these. The code I need help with is this:
<%While NOT rsGlobalWeb.EOF %>
<Option ="<%= rsGlobalWeb.Fields("id"%> "><%= rsGlobalWeb.Fields("&criteria&"%></option>
The &criteria& above is the variable, which can be any of the values chosen by the user. I need to know the correct syntax to do this.
If anyone can help me with one or both of these problems I will greatly appreciate it.
Daniel
[sig][/sig]
I've got two problems. The first problem is that I am trying to populate a listbox with values from a database, but without them repeating. I have 50 south and 50 north and would like the listbox to just list 1 south and 1 north. With the code that I have generated I get 50 south ano none of the north. Here is that piece of code:
Set objDC = Server.CreateObject("ADODB.Connection"
objDC.open("act1"
Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset"
rsGlobalWeb.Open "act1", objDC, Search
Search = "Select DISTINCT Criteria from act1"
If NOT rsGlobalWeb.BOF Then%>
<form method="Post">
<Select Name = "Criteria1">
<Option Selected>--Select Criteria--
(...)
Now, the second problem is I am trying to assign a variable to what fields will populate the listbox. So if the user chooses chapter, committee, or directors the listbox will be populated with the fields under these. The code I need help with is this:
<%While NOT rsGlobalWeb.EOF %>
<Option ="<%= rsGlobalWeb.Fields("id"%> "><%= rsGlobalWeb.Fields("&criteria&"%></option>
The &criteria& above is the variable, which can be any of the values chosen by the user. I need to know the correct syntax to do this.
If anyone can help me with one or both of these problems I will greatly appreciate it.
Daniel
[sig][/sig]