search data with apostrophes

Results 1 to 3 of 3

Thread: search data with apostrophes

  1. #1
    Simon Morgan Guest

    Default search data with apostrophes

    I have a database that has data with apostrophes in it. <BR><BR>Unfortunitly the data with the apostrophes hake up a key. Does anyone have any suggestions how I can do a search via an ASP page on this key. I am at a loss as SQL doen&#039t allow me to pass data with an apostrophe (or does it?)<BR><BR>Thanks.<BR><BR>You can email me at if need be.

  2. #2
    Join Date
    Dec 1969

    Default RE: search data with apostrophes

    You can actually pass apostrophies into an SQL string. I do it by using the replace function... What you need to do is duplicate the apostrophy... e.g.<BR><BR>replace(rs.fields("fieldname"),"&#039" ,"&#039&#039")<BR><BR>That will then duplicate it for you on insert, and retriving it will be as normal.<BR><BR>C.

  3. #3
    Join Date
    Dec 1969

    Default RE: search data with apostrophes

    Encapsulate your data with the replace() function, like:<BR><BR>function ChkString(str)<BR>str = Replace(str, "&#039", "&#039&#039")<BR>ChkString = str<BR>end if<BR>end function<BR><BR><BR>

Posting Permissions

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