Special characters

Discussion in 'ASP General' started by Excel User, Sep 15, 2009.

  1. Excel User

    Excel User Guest

    Hi,

    I have a field that contains special characters (', % etc) the ' causes
    problems because it messes up the SQL insert/update command, what is the
    best way to deal with this, I tried encode but then the entry in the DB is
    not correct?

    Thanks for any advice.
    Excel User, Sep 15, 2009
    #1
    1. Advertising

  2. Excel User

    Bob Barrows Guest

    Excel User wrote:
    > Hi,
    >
    > I have a field that contains special characters (', % etc) the '
    > causes problems because it messes up the SQL insert/update command,
    > what is the best way to deal with this, I tried encode but then the
    > entry in the DB is not correct?
    >
    > Thanks for any advice.


    Use parameters. See:
    http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/72e36562fee7804e

    Personally, I prefer using stored procedures, or saved parameter queries
    as they are known in Access:

    Access:
    http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=

    http://groups.google.com/groups?hl=...=1&selm=

    SQL Server:
    http://groups.google.com/group/microsoft.public.inetserver.asp.general/msg/5d3c9d4409dc1701?hl=en



    --
    HTH,
    Bob Barrows
    Bob Barrows, Sep 15, 2009
    #2
    1. Advertising

  3. You double them.

    --
    Sylvain Lafontaine, ing.
    MVP - Windows Live Platform
    Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
    Independent consultant and remote programming for Access and SQL-Server
    (French)


    "Excel User" <> wrote in message
    news:%...
    > Hi,
    >
    > I have a field that contains special characters (', % etc) the ' causes
    > problems because it messes up the SQL insert/update command, what is the
    > best way to deal with this, I tried encode but then the entry in the DB is
    > not correct?
    >
    > Thanks for any advice.
    Sylvain Lafontaine, Sep 22, 2009
    #3
    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. Jonah Olsson

    Special characters with DrawString?!

    Jonah Olsson, Oct 1, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,367
    Dmitriy Lapshin [C# / .NET MVP]
    Oct 3, 2003
  2. Stefan Mueller
    Replies:
    3
    Views:
    33,003
    Stefan Mueller
    Jul 23, 2006
  3. Replies:
    2
    Views:
    1,089
    Ingo Menger
    May 31, 2007
  4. rvino
    Replies:
    0
    Views:
    4,651
    rvino
    Aug 14, 2007
  5. majna
    Replies:
    4
    Views:
    663
    Thomas 'PointedEars' Lahn
    Sep 19, 2007
Loading...

Share This Page