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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking a Drop Down Menu to a Database

Status
Not open for further replies.

AJ1982

Technical User
Jun 13, 2001
644
GB
I would like to know how to place the values from an Access database into a drop down menu box created in FrontPage 2000. Someone tells me it is related to ASP although it seems I can find help about anything but this.

Any solutions would be greatly appreciated.

Thankyou
 
I really recommend you to check out the ASP forum on tek-tips. Lately I've seen lots of errors and unfinished jobs when too busy man has used a database, so be sure what you do before you gotta do it all over again :)


Microsoft: Active Server Pages (ASP) is the name of the forum I mentioned.. sorry for not being much help :(
 
hi,

I'm not sure about Frontpage and would advice against using it, ASP is not that hard, you can have cleaner code by hand.
Here is an example:

<form method=&quot;post&quot; action=&quot;target.asp&quot;>
<select name=&quot;data&quot; size=&quot;1&quot;>
<%
Dim ssql, tsql, conn, rs
ssql = &quot;SELECT id, name FROM table;&quot;

set conn = Server.CreateObject(&quot;ADODB.connection&quot;)
conn.open &quot;Driver={Microsoft Access Driver (*.mdb)}; DBQ=c:\fullpath\db1.mdb&quot;

set rs = conn.execute(ssql)
Do While Not rs.EOF
response.write(&quot;<option value='&quot; & rs(&quot;id&quot;) & &quot;'> &quot; & rs(&quot;name&quot;))
rs.MoveNext
Loop
rs.Close
%>
</select>
</form>
Bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top