Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: How do I populate a dropdown menu from database entries?


Message #1 by "Ritch Soriano" <mastamage@h...> on Sat, 14 Apr 2001 03:39:11
I tried using arrays in JavaScript.  But I need to update the dropdown 

menu when something is added or deleted in the database.  How can I link 

the dropdown object to the entries in the database?  By the way, I'm using 

MS Access.  Thanks!
Message #2 by "Daniel O'Dorisio" <dodorisio@h...> on Sat, 14 Apr 2001 08:04:55 -0400
think about it... the database is on the server.. so you cant do it on the

fly in a live window..(that i am aware of)



but what you can do is this, and it will populate the select box with all

the records in the db



Response.Write "<SELECT name=""name"">"

Response.Write "<option value="""">(Select a blah)</option>"



	Do Until objRs.eof

		Response.Write "<option value=""" & objrs("value") & """>"

		Response.Write objRs("displaytext")

		Response.Write "</option">

		objrs.movenext

	Loop

Response.Write "</SELECT>"





hope that helps



Daniel



-----Original Message-----

From: Ritch Soriano [mailto:mastamage@h...]

Sent: Saturday, April 14, 2001 6:47 AM

To: ASP Web HowTo

Subject: [asp_web_howto] How do I populate a dropdown menu from database

entries?





I tried using arrays in JavaScript.  But I need to update the dropdown

menu when something is added or deleted in the database.  How can I link

the dropdown object to the entries in the database?  By the way, I'm using

MS Access.  Thanks!




  Return to Index