quiero comprobar mi correo electronico

K

kleper carabali

De: "Rocky" <[email protected]>
Asunto: Trouble with Data entry with the name starting with O'B...
Fecha: lunes, 03 de marzo de 2008 15:59

Don't know where to look, but had this problem before. With names like
"O'Brien"? Getting a Syntax error #3077 ( Access database seems like it
doesn't like the apostrophe character ('). Any solution to this problem?
 
S

Sylvain Lafontaine

Sure: double each apostrophe character (' or single quote) when building
your sql string but only when the delimiter for the string value is itself
the apostrophe, not the double quote. Same thing for double quotes: you
have to double them if the delimiter is itself a double quote:

"... Where Name = '" & Replace ("O'Brien", "'", "''") & "' ...."

Notice that the overal delimiter for the sql string is the double quote (")
but that the inside delimiter around the name value is a single quote; hence
the necessity of doubling the single quote inside the name O'Brien.
 
Top