Characters to Replace in QueryString

Discussion in 'ASP General' started by Fawke101, Apr 6, 2004.

  1. Fawke101

    Fawke101 Guest

    Hi there,

    I have an ASP/SQL application that uses data from a querystring to run an
    SQL SELECT statement.
    Some of the data in the querystring could contain apostrophies, so i run the
    following Replace statement:

    ***
    strArea = Replace(Session("lstArea"),"'","''")
    ***

    This works and successfully pulls the records down from the database when
    using a SELECT statement and the strArea variable.

    I am having some trouble getting records when there are commas and &'s in
    the querystring. What characters do not go into a SELECT statement (like
    apostrophies)?????
    Do i have to issue more of these Replace statements to get around other
    invalid syntax characters for SELECT statements????

    Thanks


    --
    Thanks in advance

    Fawke

    Please remove ANTI and SPAM
    from my email address before emailing me.

    www.bradflack.com
     
    Fawke101, Apr 6, 2004
    #1
    1. Advertising

  2. Fawke101

    Fawke101 Guest

    Ok, Server.URLEncode seems to be doing the trick now.....

    Thanks anyway

    --
    Thanks in advance

    Fawke

    Please remove ANTI and SPAM
    from my email address before emailing me.

    www.bradflack.com
    "Fawke101" <> wrote in message
    news:...
    > Hi there,
    >
    > I have an ASP/SQL application that uses data from a querystring to run an
    > SQL SELECT statement.
    > Some of the data in the querystring could contain apostrophies, so i run

    the
    > following Replace statement:
    >
    > ***
    > strArea = Replace(Session("lstArea"),"'","''")
    > ***
    >
    > This works and successfully pulls the records down from the database when
    > using a SELECT statement and the strArea variable.
    >
    > I am having some trouble getting records when there are commas and &'s in
    > the querystring. What characters do not go into a SELECT statement (like
    > apostrophies)?????
    > Do i have to issue more of these Replace statements to get around other
    > invalid syntax characters for SELECT statements????
    >
    > Thanks
    >
    >
    > --
    > Thanks in advance
    >
    > Fawke
    >
    > Please remove ANTI and SPAM
    > from my email address before emailing me.
    >
    > www.bradflack.com
    >
    >
     
    Fawke101, Apr 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Navanith
    Replies:
    2
    Views:
    5,275
    Navanith
    Dec 30, 2003
  2. Mehdi
    Replies:
    6
    Views:
    36,138
    sloan
    Apr 6, 2006
  3. Targa

    Replace QueryString part

    Targa, Feb 28, 2004, in forum: ASP General
    Replies:
    3
    Views:
    158
    Evertjan.
    Feb 29, 2004
  4. Adeel Ahmad
    Replies:
    1
    Views:
    536
    Anthony Jones
    Mar 7, 2006
  5. Debbie Davis
    Replies:
    1
    Views:
    492
    Randy Webb
    May 13, 2004
Loading...

Share This Page