To populate a drop down list with values from Recorset

Results 1 to 3 of 3

Thread: To populate a drop down list with values from Recorset

  1. #1
    Join Date
    Dec 1969
    Posts
    9

    Default To populate a drop down list with values from Recorset

    hi,<BR>i&#039m having a problem to populate the drop down list which is in a form. i retrieve records from a database and i have populate the list box with these values. how do i do this as i am not able to do it from within the Body tag and also in the clicked event of a button.<BR>please advise.<BR><BR>Regards,<BR>Shruthi.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: To populate a drop down list with values from Recorset

    There is a code snippet of how to do this over at ActiveServerPages.com:<BR><BR>http://www.activeserverpages.com/learn/dblist.asp<BR><BR>It should get you on your way...

  3. #3
    Manpreet Guest

    Default RE: To populate a drop down list with values from Recorset

    hi there,<BR>populating a drop down is too simple.<BR>see the following code ..<BR><BR>&#060;%<BR>set rs = conn.execute("select emp_id,emp_name from employees")<BR>%&#062;<BR><BR>&#060;form method.....&#062;<BR>&#060;select name = "emplist" size=1&#062;<BR>&#060;%<BR>Do while not rs.eof<BR>Response.write "&#060;option value=" & rs(0)& "&#062;" & rs(1) & "&#060;/option&#062;"<BR><BR>rs.movenext<BR>Loop<BR>%&#062 ;<BR>&#060;/select&#062;<BR>&#060;/form&#062;<BR><BR>that&#039s it!<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •