Is there bug with ' apostrophe ' use?

Last post 06-29-2004, 10:31 AM by kimlarocca. 2 replies.
Sort Posts: Previous Next
  •  06-26-2004, 1:41 PM 1105

    Is there bug with ' apostrophe ' use?

    Hi, I bought CuteEditor for ASP and found that I can't save anything entered into the editor if an apostrophe is used. Quotes are fine, but a single apostrophe ' results in an error. Is this a bug with CuteEditor or a problem with my database? The information entered is saved to an Access Database in a Memo field.

     
    Thanks in advance for any help!
     
    Kim
  •  06-26-2004, 9:29 PM 1108 in reply to 1105

    Re: Is there bug with ' apostrophe ' use?

    Kim,
     
    This is not an editor related issue.
     
    The proper string delimiter in SQL is the single apostrophe.
     
    To indicate that a string itself contains a single apostrophe, one must double it up. It is the responsibility of the front-end application to present queries to Access/SQL so that Access/SQL can parse them.
     
    So your front-end application has to have an extra step to take the search phrase from the user, scan it for single apostrophe and insert an extra apostrophe before handling it over to Access/SQL.
    When building your SQL Query, replace all apostrophes with double
    apostrophes:

    replace(variabletoreplace, "'", "''")

    This lets Access/SQL know that you mean the apostrophe to be in the string
    and not the end of that data field.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-29-2004, 10:31 AM 1125 in reply to 1108

    Re: Is there bug with ' apostrophe ' use?

    Thank you for the help, Adam! That did the trick and everything is working great.

     
    Kim ;)
View as RSS news feed in XML