Results 1 to 2 of 2

Thread: Please Help with QueryString

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63

    Question

    I have posted multiple times and find my self in the same spot I would like to basically start over.

    If any could give me an example on how i can retrieve variables from a url the I populated from a previous page and use them to call data from a database that would be so great...

    To better explain my self I would like to have a piece of code that would work in the following manner...

    Code:
    ===========================================================

    <%@ LANGUAGE=VBSCRIPT %>

    <%
    SET CONN = SERVER.CREATEOBJECT ("ADODB.CONNECTION")
    CONN.OPEN "MYDSN"
    %>

    <%
    DIM STORE
    DIM MTYPE
    DIM rsSUBJ

    SET STORE = REQUEST.QUERYSTRING("STOREID")
    SET MTYPE = REQUEST.QUERYSTRING("TYPE")

    SET rsLOCATION = CONN.EXECUTE("SELECT ID, LOCATION FROM CIEMPDIR WHERE ID = " _
    & STORE )

    SET rsSUBJ = CONN.EXECUTE("SELECT emaillist.Id, emaillist.sub, emaillist.type FROM emaillist WHERE (((emaillist.Id)=" & STORE) AND ((emaillist.type)=" & MTYPE)) ")

    SET rsBODY = CONN.EXECUTE("SELECT emaillist.Id, emaillist.body, emaillist.type FROM emaillist WHERE (((emaillist.Id)=11) AND ((emaillist.type)='week')) ")

    %>

    ===========================================================

    rsLOCATION works fine... but there again my problem lies only when i try to write code that allows a variable like rsSUBJ and rsBODY...

    On rsBODY I manually entered one set of the values manually to see if I was atleast remotley close and it worked but when I try to automate the process by having it retrieve the variables from the url using the request.querystring I always error out with some kind of sytax thing.

    Please adivse... Help would be greatly apreciated...

    Kind Regards,
    Hakan

  2. #2
    Member
    Join Date
    Nov 1999
    Posts
    48
    Does SET myvar = request.querysting("id") work?

    I always use it without the SET. Maybe the SET is your problem?

Posting Permissions

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



Click Here to Expand Forum to Full Width