Professional Web Applications Themes

how to handle single quotation marks - ASP

Just wonder how you guys handle the single quatation marks when you write the value of a text input into SQL server. Thanks! * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * * Developer Resources for High End Developers....

  1. #1

    Default how to handle single quotation marks

    Just wonder how you guys handle the single quatation marks when you
    write the value of a text input into SQL server. Thanks!

    * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    Developer Resources for High End Developers.
    new Guest

  2. #2

    Default Re: how to handle single quotation marks

    Double them up.
    [url]www.aspfaq.com/2035[/url]


    "new" <newasp.net> wrote in message
    news:3f0ae6f2$0$203$75868355news.frii.net...
    > Just wonder how you guys handle the single quatation marks when you
    > write the value of a text input into SQL server. Thanks!
    >
    > * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    > Developer Resources for High End Developers.

    Aaron Bertrand - MVP Guest

  3. #3

    Default Re: how to handle single quotation marks

    I wrote a replaceall function to handle this problem and create a DLL with
    common string functions:

    Function ReplaceAll(ByVal Buffer As String, ByVal FindWhat As String, _
    ByVal ReplaceWith As String) As Variant
    '
    ' Replaces all instances of FindWhat with ReplaceWith in the
    ' buffer
    '
    Dim intLenFind As Integer
    Dim intLenReplace As Integer
    Dim intPos As Integer

    If Len(Buffer) = 0 Then
    ReplaceAll = ""
    Else
    intLenFind = Len(FindWhat)
    intLenReplace = Len(ReplaceWith)

    intPos = 1
    Do
    intPos = InStr(intPos, Buffer, FindWhat)
    If intPos > 0 Then
    Buffer = Left(Buffer, intPos - 1) & _
    ReplaceWith & Mid(Buffer, intPos + intLenFind)
    intPos = intPos + intLenReplace
    End If
    Loop Until intPos = 0
    End If

    ReplaceAll = Buffer

    End Function
    "new" <newasp.net> wrote in message
    news:3f0ae6f2$0$203$75868355news.frii.net...
    > Just wonder how you guys handle the single quatation marks when you
    > write the value of a text input into SQL server. Thanks!
    >
    > * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    > Developer Resources for High End Developers.

    solex Guest

  4. #4

    Default Re: how to handle single quotation marks

    Thank you!

    I was doing a similar thing, by replacing ' to something like #$% :)

    * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    Developer Resources for High End Developers.
    new Guest

  5. #5

    Default Re: how to handle single quotation marks

    > I was doing a similar thing, by replacing ' to something like #$% :)

    And then switching it back again, in every single application that connects
    to that table? Ick...


    Aaron Bertrand - MVP Guest

Similar Threads

  1. anybody getting quotation marks
    By mgarbe in forum Macromedia Flash Player
    Replies: 1
    Last Post: May 11th, 08:16 PM
  2. CFSET and Quotation Marks
    By fs22 in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: April 29th, 03:34 PM
  3. Replacing quotation marks
    By J. Muenchbourg in forum ASP
    Replies: 6
    Last Post: November 14th, 03:27 PM
  4. Tyogrpaher's Quotation Marks?
    By greenchain webforumsuser@macromedia.com in forum Macromedia Fireworks
    Replies: 4
    Last Post: August 27th, 08:40 PM
  5. Quotation marks
    By Pyro Dude webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: July 15th, 05:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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