Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


database interaction web page

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,269
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> database interaction web page
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 database interaction web page - 7/13/2001 11:36:49 AM   
  pedx

 

Posts: 16
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
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!
 
 
Post #: 1
 
 Re: database interaction web page - 7/13/2001 11:39:42 AM   
  subnation

 

Posts: 20
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
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
%>

(in reply to pedx)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> database interaction web page Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts