Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: SQL Help plz

  1. #1
    Join Date
    Jan 2004
    Posts
    15

    Unanswered: 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?

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    ASP = request.QueryString("param name")
    Last edited by r123456; 01-15-04 at 12:21.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

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

  4. #4
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    ...?dropdown=value1

    <%
    Dim str As String
    str = request.QueryString("dropdown")
    %>
    Last edited by r123456; 01-15-04 at 12:20.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

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

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

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

  8. #8
    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
    --------^

  9. #9
    Join Date
    Dec 2003
    Posts
    454
    Please post your code here.

  10. #10
    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?

  11. #11
    Join Date
    Dec 2003
    Posts
    454
    It should be

    <% str = request.QueryString("dropdown") %>

  12. #12
    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???

  13. #13
    Join Date
    Dec 2003
    Posts
    454
    Are you using ASP programming? If yes,

    Dim str As String

    should be

    Dim str

  14. #14
    Join Date
    Jan 2004
    Posts
    15
    okay so i did that and how ould i display what is saved in the str variable??/

  15. #15
    Join Date
    Dec 2003
    Posts
    454
    Two ways:

    <%= str %>

    or

    <% Response.Write str %>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •