Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting ASP dropdown menus to Oracle tables

Status
Not open for further replies.

cdumigan

MIS
Feb 5, 2002
16
0
0
IE
Hi there,
I posted this question already but didn't get much joy, so forgive me for trying again.
I am trying to create dropdown menus (not list boxes)in ASP that will read values from an Oracle table. Does anyone know the code to do this?? I have my tables created and populated in Oracle, I just need to read the values form them to the front end dropdowns. Any help would be greatly appreciated. Thanks in advance,
C
 
hope this helps
Your <asp code>
<%
Conn = connection 'Your connection to DB

Function FillDropdownbox()
sql = &quot;Select * from table&quot;
set rs = conn.Execute(sql)
soptions = &quot; &quot;
While not rs.eof then
soptions= soptions & &quot;<OPTION VALUE='&quot; &
rs&quot;Column_Name&quot;)&&quot;'>&quot; & rs(&quot;Column_name&quot;)
& &quot;</OPTION>&quot;
rs.movenext
Wend
FillDropdownbox = soptions
End function

%>

Now where you have defined the Drop down box in your html
put the following code
<SELECT ID=&quot;sel1&quot;><%=FillDropdownbox%></SELECT>


FillDropdownbox will basically write your html code alongwith the data.
Let me know if you need more info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top