×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

database interaction web page

database interaction web page

database interaction web page

(OP)
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!

-Marc

RE: database interaction web page

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
%>

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close