PDA

View Full Version : Populating ComboBox


Abd
03-14-2003, 11:56 AM
Hi All,

pls need help on how to populate a combobox from an oracle Database.

thanks

Abd

arnyinc
03-14-2003, 01:24 PM
You don't need javascript for this unless you're doing something interesting that you didn't specify. You have to use ASP, PHP, or perl (which I assume you're already doing).

Here's an ASP example (untested):

<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open "DSN=my_dsn;UID=my_uid;PWD=my_pwd"

Set rs=oConn.execute("Select id, name from yourtable")

response.write "<select>"&vbcrlf
while not rs.eof
response.write "<option value="""&rs("id")&""">"&rs("name")&"</option>"&vbcrlf
rs.movenext
wend
response.write "</select>"&vbcrlf

rs.close
set rs=nothing
oConn.close
set oConn=nothing
%>

Abd
03-14-2003, 02:18 PM
Hi arnyinc,

it works really greatfull

Abd