'' and other special character friendly

Results 1 to 2 of 2

Thread: '' and other special character friendly

  1. #1
    Join Date
    Dec 1969

    Default '' and other special character friendly

    In Access if we use special characters like qqotations in forms like (jkhjfdsa",&#039;fsdafs&#039;sdfsdf&#039;) it takes it as an query and gives error we can over come this by using replace statements , I guess once Bill Wilkinson told me this. But I would like to know which is the Database which is &#039;&#039; and other special character friendly Database . Dose this problem also happens in SQL SERVER and ORACLE ?<BR><BR>thanks and best regards<BR>R

  2. #2
    Join Date
    Dec 1969

    Default The rule is same as in JavaScript...

    You can *either* enclose you literal strings in SQL with "..." or with &#039;...&#039;. <BR><BR>Whichever one you use to enclose the string is the one you must double up inside the string. The other one can be left alone.<BR><BR>So, examples:<BR><BR>SELECT ... WHERE someField = &#039;He said, "Isn&#039;&#039;t this great?" with enthusiasm.&#039;<BR><BR>*OR* <BR><BR>SELECT ... WHERE someField = "He said, ""Isn&#039;t this great?"" with enthusiasm."<BR><BR>**************<BR><BR>We usually use the first form when creating SQL from VBScript, since in order to put two quotes into the SQL string we&#039;d have to use four quotes in VBScript. Ugh.<BR><BR>And this has nothing to do with the database you use; this is just a part of the rules of the SQL language.<BR><BR>[ And in Javascript you do the same thing, but instead of doubling up the enclosing quote character in a string, you put a backslash in front of it. Such as:<BR><BR>var foo = &#039;He said, "Isn&#039;t this great?" with enthusiasm.&#039;;<BR>or<BR>var foo = "He said, \"Isn&#039;t this great?\" with enthusiasm.";<BR><BR>but you can see that the idea is the same.]<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