SQL Syntax for a single quote in a string.




Hi,
I don't know how to write a syntax in SQL if there is a quote mark in a string.
Example :
Str := 'Sawal Afa'at'; <--- a'a
...
Add('update tbl set name='''+str+''''); ---> i used 3 single quote on both sides.
.... etc
this statement will give me error.
Can someone assist me how to solve this problem? Thanks in advance

Regards,
lsg

.



Relevant Pages

  • Re: Using SQL in Sub to fill box on mouseclick
    ... In addition to Doug's point on the SQL syntax, ... This is because the first " character in your SQL string will be seen by VBA ...
    (microsoft.public.access.formscoding)
  • Re: Mailmerge, querystring and (un)logical SQL (Word 2003)
    ... Dim vsl, qs, airport_query, st_d, en_d As String ... As you can see st_d and en_d are strings formatted as dates in SQL ... the syntax of the part should be: ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Set up Parameter Query to accept more than one entry
    ... I don't know what your region field name is but I think you might have ... included two "WHERE"s in your SQL which isn't allowed. ... The expression you entered contains invalid> syntax. ... > If I try to paste the string you recommended directly into SQL View when I> save it, it gives an error message that says: ...
    (microsoft.public.access.queries)
  • Using a variable in SQL
    ... I'm trying to replace an integer number in a test WHERE string of my SQL with a variable. ... See below code snippet. ... Any syntax suggestions appreciated. ...
    (microsoft.public.vb.database)
  • Re: SQL Syntax for a single quote in a string.
    ... I don't know how to write a syntax in SQL if there is a quote mark in ... a string. ... cmd: TADOCommand; ...
    (borland.public.delphi.database.ado)