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

01-15-04, 10:31
|
|
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?
|
|

01-15-04, 10:40
|
|
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.
|

01-15-04, 10:43
|
|
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
|
|

01-15-04, 10:48
|
|
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.
|

01-15-04, 10:54
|
|
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
|
|

01-15-04, 11:22
|
|
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.
|
|

01-15-04, 14:46
|
|
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??
|
|

01-15-04, 14:48
|
|
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
--------^
|
|

01-15-04, 14:52
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 454
|
|
Please post your code here.
|
|

01-15-04, 14:57
|
|
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?
|
|

01-15-04, 15:01
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 454
|
|
It should be
<% str = request.QueryString("dropdown") %>
|
|

01-15-04, 15:04
|
|
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???
|
|

01-15-04, 15:07
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 454
|
|
Are you using ASP programming? If yes,
Dim str As String
should be
Dim str
|
|

01-15-04, 15:08
|
|
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??/
|
|

01-15-04, 15:26
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 454
|
|
Two ways:
<%= str %>
or
<% Response.Write str %>
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|