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

  1. #1

    Default Problem with %

    Hello!
    I have a SELECT comand passed trhough ASP like This:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    ""%Efectuar%"" ORDER BY PK_A_MSGID

    and when i pass it it gives me:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    "ïectuar" ORDER BY PK_A_MSGID

    Why? how can i correct this?
    Thanks


    webfox Guest

  2. Similar Questions and Discussions

    1. contribute problem - access denied file may not existpermission problem
      Recieving the following error message - "access denied file may not exist , or there could be a permission problem" this happened this morning ,...
    2. Problem playing Quicktime thru .DCR embedded in HTML - pathreferencing problem?
      Greetings earthlings and Director heads. Here's the problem: created an HTML file containing shockwave (dcr) movie that calls quicktime movies in...
    3. Uploading problem = weird warning (was: access denied problem.....)
      Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the...
    4. #21611 [Opn]: Problem with version_compare() (Was: Problem with pear cli and release numbers)
      ID: 21611 Updated by: et@php.net -Summary: Problem with pear cli and release numbers Reported By: jan at horde...
    5. Problem with Apache Web Server config file and PHP (please give advice on what problem may be me)
      HI: Can anyone refer me to someone that can help with the problem below. I installed Apache Web Server on my laptop which has Windows XP. I...
  3. #2

    Default Problem with %

    Hello!
    I have a SELECT comand passed trhough ASP like This:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    ""%Efectuar%"" ORDER BY PK_A_MSGID

    and when i pass it it gives me:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    "ïectuar" ORDER BY PK_A_MSGID

    Why? how can i correct this?
    Thanks


    webfox Guest

  4. #3

    Default Problem with %

    Hello!
    I have a SELECT comand passed trhough ASP like This:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    ""%Efectuar%"" ORDER BY PK_A_MSGID

    and when i pass it it gives me:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    "ïectuar" ORDER BY PK_A_MSGID

    Why? how can i correct this?
    Thanks


    webfox Guest

  5. #4

    Default Problem with %

    Hello!
    I have a SELECT comand passed trhough ASP like This:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    ""%Efectuar%"" ORDER BY PK_A_MSGID

    and when i pass it it gives me:

    SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    "ïectuar" ORDER BY PK_A_MSGID

    Why? how can i correct this?
    Thanks


    webfox Guest

  6. #5

    Default Re: Problem with %

    I don't know what the story is with the %'s disappearing, but you should be
    using ' to delimit in SQL, not ".

    sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE
    C3_MSG LIKE '%Efectuar%' ORDER BY PK_A_MSGID"

    Ray at home

    "webfox" <webfox@sapo.pt> wrote in message
    news:e4hVL%23dkDHA.964@TK2MSFTNGP10.phx.gbl...
    > Hello!
    > I have a SELECT comand passed trhough ASP like This:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > ""%Efectuar%"" ORDER BY PK_A_MSGID
    >
    > and when i pass it it gives me:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > "ïectuar" ORDER BY PK_A_MSGID
    >
    > Why? how can i correct this?
    > Thanks
    >
    >

    Ray at Guest

  7. #6

    Default Re: Problem with %

    Asked an answered in .general.
    [url]www.aspfaq.com/5003[/url]

    Ray at home

    "webfox" <webfox@sapo.pt> wrote in message
    news:uVhrC%23dkDHA.2012@TK2MSFTNGP12.phx.gbl...
    > Hello!
    > I have a SELECT comand passed trhough ASP like This:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > ""%Efectuar%"" ORDER BY PK_A_MSGID
    >
    > and when i pass it it gives me:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > "ïectuar" ORDER BY PK_A_MSGID
    >
    > Why? how can i correct this?
    > Thanks
    >
    >

    Ray at Guest

  8. #7

    Default Re: Problem with %

    Asked and answered in .general.

    Please see here again. [url]www.aspfaq.com/5003[/url]

    Ray at home

    "webfox" <webfox@sapo.pt> wrote in message
    news:3f8b310a$0$5510$a729d347@news.telepac.pt...
    > Hello!
    > I have a SELECT comand passed trhough ASP like This:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > ""%Efectuar%"" ORDER BY PK_A_MSGID
    >
    > and when i pass it it gives me:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > "ïectuar" ORDER BY PK_A_MSGID
    >
    > Why? how can i correct this?
    > Thanks
    >
    >

    Ray at Guest

  9. #8

    Default Re: Problem with %

    if i use ' instead off " give me :

    sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE
    C3_MSG LIKE

    "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    news:#fhuQKekDHA.2216@TK2MSFTNGP12.phx.gbl...
    > I don't know what the story is with the %'s disappearing, but you should
    be
    > using ' to delimit in SQL, not ".
    >
    > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE
    > C3_MSG LIKE '%Efectuar%' ORDER BY PK_A_MSGID"
    >
    > Ray at home
    >
    > "webfox" <webfox@sapo.pt> wrote in message
    > news:e4hVL%23dkDHA.964@TK2MSFTNGP10.phx.gbl...
    > > Hello!
    > > I have a SELECT comand passed trhough ASP like This:
    > >
    > > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    > LIKE
    > > ""%Efectuar%"" ORDER BY PK_A_MSGID
    > >
    > > and when i pass it it gives me:
    > >
    > > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    > LIKE
    > > "ïectuar" ORDER BY PK_A_MSGID
    > >
    > > Why? how can i correct this?
    > > Thanks
    > >
    > >
    >
    >

    webfox Guest

  10. #9

    Default Re: Problem with %

    How about posting the relevant code snippet you're using to generate this
    string?

    Ray at home

    "webfox" <webfox@sapo.pt> wrote in message
    news:u0yawbekDHA.3504@TK2MSFTNGP11.phx.gbl...
    > if i use ' instead off " give me :
    >
    > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE
    > C3_MSG LIKE
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > news:#fhuQKekDHA.2216@TK2MSFTNGP12.phx.gbl...
    > > I don't know what the story is with the %'s disappearing, but you should
    > be
    > > using ' to delimit in SQL, not ".
    > >
    > > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE
    > > C3_MSG LIKE '%Efectuar%' ORDER BY PK_A_MSGID"
    > >
    > > Ray at home
    > >
    > > "webfox" <webfox@sapo.pt> wrote in message
    > > news:e4hVL%23dkDHA.964@TK2MSFTNGP10.phx.gbl...

    Ray at Guest

  11. #10

    Default Re: Problem with %

    this use 3 scripts with querystring pass

    "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    news:#EbFYeekDHA.1884@TK2MSFTNGP09.phx.gbl...
    > How about posting the relevant code snippet you're using to generate this
    > string?
    >
    > Ray at home
    >
    > "webfox" <webfox@sapo.pt> wrote in message
    > news:u0yawbekDHA.3504@TK2MSFTNGP11.phx.gbl...
    > > if i use ' instead off " give me :
    > >
    > > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE
    > > C3_MSG LIKE
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > > news:#fhuQKekDHA.2216@TK2MSFTNGP12.phx.gbl...
    > > > I don't know what the story is with the %'s disappearing, but you
    should
    > > be
    > > > using ' to delimit in SQL, not ".
    > > >
    > > > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS
    WHERE
    > > > C3_MSG LIKE '%Efectuar%' ORDER BY PK_A_MSGID"
    > > >
    > > > Ray at home
    > > >
    > > > "webfox" <webfox@sapo.pt> wrote in message
    > > > news:e4hVL%23dkDHA.964@TK2MSFTNGP10.phx.gbl...
    >
    >

    webfox Guest

  12. #11

    Default Re: Problem with %

    How about posting the relevant code snippet you're using to generate this
    string?

    Ray at home

    "webfox" <webfox@sapo.pt> wrote in message
    news:%231ChGjekDHA.2424@TK2MSFTNGP10.phx.gbl...
    > this use 3 scripts with querystring pass
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message
    > news:#EbFYeekDHA.1884@TK2MSFTNGP09.phx.gbl...
    > > How about posting the relevant code snippet you're using to generate
    this
    > > string?
    > >
    > > Ray at home
    > >
    > > "webfox" <webfox@sapo.pt> wrote in message
    > > news:u0yawbekDHA.3504@TK2MSFTNGP11.phx.gbl...
    > > > if i use ' instead off " give me :
    > > >
    > > > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS
    WHERE
    > > > C3_MSG LIKE
    > > >
    > > > "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in
    message
    > > > news:#fhuQKekDHA.2216@TK2MSFTNGP12.phx.gbl...
    > > > > I don't know what the story is with the %'s disappearing, but you
    > should
    > > > be
    > > > > using ' to delimit in SQL, not ".
    > > > >
    > > > > sSQL = "SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS
    > WHERE
    > > > > C3_MSG LIKE '%Efectuar%' ORDER BY PK_A_MSGID"
    > > > >
    > > > > Ray at home
    > > > >
    > > > > "webfox" <webfox@sapo.pt> wrote in message
    > > > > news:e4hVL%23dkDHA.964@TK2MSFTNGP10.phx.gbl...
    > >
    > >
    >
    >

    Ray at Guest

  13. #12

    Default Re: Problem with %

    On Tue, 14 Oct 2003 00:17:01 +0100, "webfox" <webfox@sapo.pt> wrote:
    >Hello!
    >I have a SELECT comand passed trhough ASP like This:
    >
    >SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    >""%Efectuar%"" ORDER BY PK_A_MSGID
    >
    >and when i pass it it gives me:
    >
    >SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG LIKE
    >"ïectuar" ORDER BY PK_A_MSGID
    >
    >Why? how can i correct this?
    >Thanks
    >
    Wouldnt the %E be converted to a character? In other words, it's
    translating just like %20 becomes a space. %EF if some high order
    character.

    Try doing an encoding on the string before passing it.

    Dan Brussee Guest

  14. #13

    Default Re: Problem with %

    Pass through the form collection instead of the querystring collection.
    Aside from the string formatting issues, think about what the user could do
    to this URL:

    [url]http://www.yourserver.com/page.asp?query=SELECT+*+FROM+table[/url]

    Could easily become:

    [url]http://www.yourserver.com/page.asp?query=DROP+TABLE+table[/url]

    Use ' not "" for delimiting the string, and consider passing only the
    dynamic portion of the query...





    "webfox" <webfox@sapo.pt> wrote in message
    news:e4hVL#dkDHA.964@TK2MSFTNGP10.phx.gbl...
    > Hello!
    > I have a SELECT comand passed trhough ASP like This:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > ""%Efectuar%"" ORDER BY PK_A_MSGID
    >
    > and when i pass it it gives me:
    >
    > SELECT PK_A_MSGID, C3_MSG, C3_MSGPT, C3_MSGEN FROM S_MSGS WHERE C3_MSG
    LIKE
    > "ïectuar" ORDER BY PK_A_MSGID
    >
    > Why? how can i correct this?
    > Thanks
    >
    >

    Aaron Bertrand - MVP Guest

  15. #14

    Default Re: Problem with %

    "Aaron Bertrand - MVP" wrote:
    >
    > Pass through the form collection instead of the querystring
    > collection. Aside from the string formatting issues, think
    > about what the user could do to this URL:
    >
    > [url]http://www.yourserver.com/page.asp?query=SELECT+*+FROM+table[/url]
    >
    > Could easily become:
    >
    > [url]http://www.yourserver.com/page.asp?query=DROP+TABLE+table[/url]
    Can someone please explain how changing to the form collection protects me
    from this type of malicious submission? Assuming the user is sophisticated
    enough to form a damaging request, I see no reason to think he could not
    tweak a form submission with as much ease as a querystring.
    > Use ' not "" for delimiting the string, and consider passing
    > only the dynamic portion of the query...
    Consider? This should be a point of evangelism. If it's worth the time spent
    to develop, it's worth a few minutes more to construct a stored procedure,
    the benefits of which exceed simple prevention of malicious code execution.


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.


    Dave Anderson Guest

  16. #15

    Default Re: Problem with %

    > Can someone please explain how changing to the form collection protects me
    > from this type of malicious submission?
    It doesn't protect you, per se, but it makes it easier to validate (since
    you can add referrer checks, session data, elapsed time, etc. to make sure
    the form came from where you expect it to).


    Aaron Bertrand - MVP 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