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

  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, Apr 6, 2004
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.