Using Invalid Characters

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Using Invalid Characters

    I am using MS SQL for my ASP application and have several 'comments' fields.
    Obviously in these fields users are going to enter invalid characters and
    when they try to submit they will receive an error message. How can I deal
    with these invalid characters so the information they are trying to submit
    is entered.

    On [url]http://www.aspfaq.com/show.asp?id=2399[/url] I found the following list of
    invalid characters ",<.>?;:'@#~]}[{=+)(*&^%$£!`¬| -_". Is there a way to
    escape each of these characters as they are found before submitting to the
    database?

    Thank you,

    --
    "Some see the glass as half-empty;
    some see the glass as half-full.
    I see the glass as too big." - George Carlin

    - J


    Jay Guest

  2. Similar Questions and Discussions

    1. error invalid characters in my cfquery?
      The list. What is that datatype your passing the list to? Is it an numeric based or string? If it is a string (char, varchar, ntext, nvarchar,...
    2. Matching invalid characters in a URL
      I'm trying to throw out URLs with any invalid characters in them, like '@". According to http://www.ietf.org/rfc/rfc1738.txt : Thus, only...
    3. #25405 [Opn->Bgs]: The session id contains invalid characters
      ID: 25405 Updated by: iliaa@php.net Reported By: pop501 at hotmail dot com -Status: Open +Status: ...
    4. [PHP] Invalid Characters, XML...
      Here's what I have been using. $trans= array("'" => "&#39;", "'" => "&#39;",">" => "&#62;", "<" => "&#60;", "&" => "&#38;","-" => "&#45;", "°" => "&#176;", "±" => "&#177;", "-"...
    5. Invalid Characters, XML...
      Im using PHP to write to XML files, but I am having some problems. A lot of users are cutting and pasting content from text editors like word,...
  3. #2

    Default Re: Using Invalid Characters

    That's my own made up invalid list. The only character that should cause a
    problem in a SQL statement is an apostrophe (since it's also used to delimit
    the string). See [url]http://www.aspfaq.com/2035[/url]

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "Jay" <jerry280@yahoo.com> wrote in message
    news:%23XNEkqfLEHA.3664@TK2MSFTNGP10.phx.gbl...
    >I am using MS SQL for my ASP application and have several 'comments'
    >fields.
    > Obviously in these fields users are going to enter invalid characters and
    > when they try to submit they will receive an error message. How can I deal
    > with these invalid characters so the information they are trying to submit
    > is entered.
    >
    > On [url]http://www.aspfaq.com/show.asp?id=2399[/url] I found the following list of
    > invalid characters ",<.>?;:'@#~]}[{=+)(*&^%$£!`¬| -_". Is there a way to
    > escape each of these characters as they are found before submitting to the
    > database?
    >
    > Thank you,
    >
    > --
    > "Some see the glass as half-empty;
    > some see the glass as half-full.
    > I see the glass as too big." - George Carlin
    >
    > - J
    >
    >

    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: Using Invalid Characters

    Thanks Aaron.

    I used to use MS Access and if I recall correctly we had some issues with
    other characters but after testing some of them with the SQL Server it looks
    as though it is only the apostrophe that needs to be dealt with. Thank you
    for the tip and the great site!

    --
    "Some see the glass as half-empty;
    some see the glass as half-full.
    I see the glass as too big." - George Carlin

    - J

    "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
    news:e7uZ0XgLEHA.2576@TK2MSFTNGP12.phx.gbl...
    > That's my own made up invalid list. The only character that should cause
    a
    > problem in a SQL statement is an apostrophe (since it's also used to
    delimit
    > the string). See [url]http://www.aspfaq.com/2035[/url]
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > [url]http://www.aspfaq.com/[/url]
    >
    >
    >
    >
    > "Jay" <jerry280@yahoo.com> wrote in message
    > news:%23XNEkqfLEHA.3664@TK2MSFTNGP10.phx.gbl...
    > >I am using MS SQL for my ASP application and have several 'comments'
    > >fields.
    > > Obviously in these fields users are going to enter invalid characters
    and
    > > when they try to submit they will receive an error message. How can I
    deal
    > > with these invalid characters so the information they are trying to
    submit
    > > is entered.
    > >
    > > On [url]http://www.aspfaq.com/show.asp?id=2399[/url] I found the following list of
    > > invalid characters ",<.>?;:'@#~]}[{=+)(*&^%$£!`¬| -_". Is there a way to
    > > escape each of these characters as they are found before submitting to
    the
    > > database?
    > >
    > > Thank you,
    > >
    > > --
    > > "Some see the glass as half-empty;
    > > some see the glass as half-full.
    > > I see the glass as too big." - George Carlin
    > >
    > > - J
    > >
    > >
    >
    >

    Jay Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139