Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Drop Down Menus from a database
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drop Down Menus from a database

 Post Reply Post Reply
Author
judo2000 View Drop Down
Groupie
Groupie
Avatar

Joined: 05 November 2002
Location: United States
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote judo2000 Quote  Post ReplyReply Direct Link To This Post Topic: Drop Down Menus from a database
    Posted: 26 February 2003 at 1:16pm

This was addressed in another topic but it was a little different and I didn't really understand the answers anyway.
I have a web form that puts information tinto a table called employees.  I want to create a form that people can use from different venue can use to assign employees from the employees database to their venue database.  For example the JoyBurns(ice arena) table pulls emID (employeeID) from the employees table with a drop down menus.  So I can go to the database and open JoyBurns table and select an employee from a drop down menu which is populated from the employees menue.  What I can't figure out is how to get that drop down menu from the Joy Burns table into a web form so venue managers don't have to go into the database.  Any help will be greatly appreciated.

Thanks



Edited by judo2000
If you are not willing to work hard to realize your dreams, why bother dreaming?
Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2003 at 2:55am

<%
'Create  DSN Less connection to Access Database
'Create DBConnection Object
Set DBConnection = Server.CreateObject("adodb.connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.Mappath("/path_to_your/database.mdb")
DBConnection.Open DSN

'Count the Records

   SQLcount = "Select * From table"
      Set RS = DBConnection.Execute(SQLcount)

 

 Select Case RS.eof
      Case False
        tempRSCount = RS.getrows
        Set RS = Nothing
        count = Cdbl(UBound(tempRSCount, 2)) + 1
               
     Case True
      count = "0"
 End Select
     Set RS = Nothing
 

 

%>

         <select size="1" name="dropdown_name">
         <option value="choice 1">Pick one</option>

         <%
         IF count > 0 Then
      
'Display records

    
  SQL = "Select * From table"
      Set RS = DBConnection.Execute(SQL)
            
        rs.move idc
      
        while not rs.eof
         data1 = rs("data1")
         data2= rs("data2")
         idc = idc + 1
         %> 
         <option value="<%=data1%>"><%=data2%></option>
         <%
         
         rs.Movenext
        wend
       Else
       %>
       
         <option>no data to display</option><%
       End IF
  %>

Replace everything in red with your own data.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.