Results 1 to 2 of 2

Thread: A Sring Contains a Single Quotation Mark

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2001
    Location
    Canada
    Posts
    36

    A Sring Contains a Single Quotation Mark

    Hi Everybody,

    I have a problem about the single quotation mard ' in SQL statement because my data may contain the single quotation mark. For example, a city called Saint-Leonard-D'Aston. If this kind of data occurs, my query gets error message because the query treats the mark as a operator to enclose a string.

    How can I make the query know that the single quotation mark is part of string, not to enclose a string?

    Thanks a lot.

    James

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    You have to double single quotes up, like ' becomes ''

    Something like this
    VB Code:
    1. strstring = Replace(strstring, "'", "''")

Posting Permissions

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



Click Here to Expand Forum to Full Width