update query help

P

PCH

I'm trying to run a sql update query from and oledb command object to an
access 97 database.

UPDATE myTable SET MyData = ""this is what's going on "here" ok."" WHERE
MyID = ""2345""

I think the problem is with the Mydata part, with the value having full and
half quotes.

Thanks.
 
J

John Vinson

I'm trying to run a sql update query from and oledb command object to an
access 97 database.

UPDATE myTable SET MyData = ""this is what's going on "here" ok."" WHERE
MyID = ""2345""

I think the problem is with the Mydata part, with the value having full and
half quotes.

Thanks.

Try delimiting the strings with just one doublequote character, and
representing embedded doublequote characters with a pair of them:

UPDATE myTable SET MyData = "this is what's going on ""here"" ok."
WHERE MyID = "2345"

The singlequote will not need any special treatment.
 
P

PCH

Thanks worked perfectly!

John Vinson said:
Try delimiting the strings with just one doublequote character, and
representing embedded doublequote characters with a pair of them:

UPDATE myTable SET MyData = "this is what's going on ""here"" ok."
WHERE MyID = "2345"

The singlequote will not need any special treatment.
 
Top