database interaction web page

Author Message
pedx

  • Total Posts : 16
  • Scores: 0
  • Reward points : 0
  • Joined: 5/23/2001
  • Location: USA
  • Status: offline
database interaction web page Friday, July 13, 2001 12:36 PM (permalink)
0

Hi!

I need to make a page that will fill a listbox with the value of one field
from selected records from a SQL server database, let the user
choose one of the values from the listbox, then click a button and
populate a table with the rest of the information in the chosen record
(it's actually more complicated, but these are the fundamental
operations I need help with). I am pretty good with VB and have made
a web (ASP) page that populates (through VBScript) a table on the
page with the contents of a SQL table in its entirety, but I don't know
how to go both ways (i.e. choosing from list, user input). Could
someone help me out, maybe point me in the right direction? Any help
would be appreciated.

Thanks in advance!

 
#1
    subnation

    • Total Posts : 18
    • Scores: 0
    • Reward points : 0
    • Joined: 5/23/2001
    • Location: USA
    • Status: offline
    Re: database interaction web page Friday, July 13, 2001 12:39 PM (permalink)
    0


    Here is a hint:
    the page category.asp uses Request.Forms("Name of select
    box").Value to find which one was selected

    good luck

    <%
    Set DbObj = Server.CreateObject("ADODB.Connection")
    DbObj.Open "DSN=Music;USR=;PSW=;"
    SQL = "SELECT * FROM Categories"
    Set records = DbObj.Execute(SQL)
    records.MoveFirst
    %>
    <body bgcolor="wheat" onload="document.forms[0].reset()">
    <form action="category.asp" Method="post">
    <p>Open Which Catergory?</p>
    <select name="cat" size="1">
    <% WHILE NOT records.EOF %>
    <option value="<%= records.Fields("CID").Value %>"><%=
    records.Fields("CategoryName").Value %></option>
    <% records.MoveNext %>
    <% WEND %>
    </select>
    <br>
    <input type="submit" value="View Bands"><input type="Reset">
    </form>
    <%
    DbObj.close
    SET DbObj = Nothing
    %>

     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9