If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > SQL Help plz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-04, 10:31
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
SQL Help plz

hi im currently making a web page and on it it loads up data from an access database into a dropdown menu so it loads up all the names and then i want to have it so when i click on the buttton that goes to the next page which i have i want the result of what the person selected from the dropdown i notice that it is displayed in the address bar but how can i retrieve that data?> and display it on the screen?
Reply With Quote
  #2 (permalink)  
Old 01-15-04, 10:40
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
ASP = request.QueryString("param name")
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Last edited by r123456; 01-15-04 at 11:21.
Reply With Quote
  #3 (permalink)  
Old 01-15-04, 10:43
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
ok thank you very much for your help just two small question what is the ASP there for what will that do and then for the parameter name would i just put down dropdown? cuz in my address bar its displayed dropdown = "name" so what would i put for a param
Reply With Quote
  #4 (permalink)  
Old 01-15-04, 10:48
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
...?dropdown=value1

<%
Dim str As String
str = request.QueryString("dropdown")
%>
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Last edited by r123456; 01-15-04 at 11:20.
Reply With Quote
  #5 (permalink)  
Old 01-15-04, 10:54
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
alright well i tried using your code and it didnt work heres the code that i use

<html>
<% Dim str As String %>
<% str = request.getString("dropdown") %>

(str)
str
</html>

and it gives me an error on line 2 it says expected end of statement what should i do
Reply With Quote
  #6 (permalink)  
Old 01-15-04, 11:22
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
The previous statements have been corrected.
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Reply With Quote
  #7 (permalink)  
Old 01-15-04, 14:46
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
what do you mean that the previous lines have been correct? if they were correct then why did they not work??
Reply With Quote
  #8 (permalink)  
Old 01-15-04, 14:48
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
hey this is the error that i get:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/results.asp, line 2

Dim str As String
--------^
Reply With Quote
  #9 (permalink)  
Old 01-15-04, 14:52
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Please post your code here.
Reply With Quote
  #10 (permalink)  
Old 01-15-04, 14:57
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
alright here is the code for my first page which is the dropdown menu:

<html>
<% SQL="SELECT * FROM People ORDER BY Name"

set conn = server.createobject("ADODB.Connection")

conn.open "Swimming"

set people=conn.execute(SQL)

%>

<form action="results.asp" method="get" name="form3">
<select name="dropdown">

<%= people(0)%><br> <%= people(1)%><br> <%=people(2)%> </p><br>

<% do while not people.eof %>


<option value="<%= people(1)%>"><%= people(1)%></option>


<%people.movenext

loop%>

<% people.close %>




</select>
<input type="Submit" value="It Works" align="MIDDLE"> </form>

</html>

then when they click on that button its gonna take them to the result page which is were i wanna display what they selected and the code for this page looks like this


<html>
<% Dim str As String %>
<% str = request.getString("dropdown") %>

(str)
str
</html>


but i get an error that looks like what i posted above can you help me?
Reply With Quote
  #11 (permalink)  
Old 01-15-04, 15:01
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
It should be

<% str = request.QueryString("dropdown") %>
Reply With Quote
  #12 (permalink)  
Old 01-15-04, 15:04
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
no im sorry i still get the:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/results.asp, line 2

Dim str As String
--------^
any idea why???
Reply With Quote
  #13 (permalink)  
Old 01-15-04, 15:07
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Are you using ASP programming? If yes,

Dim str As String

should be

Dim str
Reply With Quote
  #14 (permalink)  
Old 01-15-04, 15:08
Canada66_2002 Canada66_2002 is offline
Registered User
 
Join Date: Jan 2004
Posts: 15
okay so i did that and how ould i display what is saved in the str variable??/
Reply With Quote
  #15 (permalink)  
Old 01-15-04, 15:26
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Two ways:

<%= str %>

or

<% Response.Write str %>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On