Help using a pipebar in an update string!!

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

Hi all. I have a little problem. I am trying to set a
field value to a string that contains a pipebar "|" and I
am having a problem doing so since SQL is taking the "|"
as an operator instead of a string.

Basically my sql statement looks like:

"Update ProductInfo Set ProductInfo.TagValue
= 'Choice1|Choice2' Where ProductInfo.TagName
= 'MEBChoices'"

and when I execute it I get a syntax error.

Can anyone shed some light on this problem for me? I have
tried to surround the text in both single and double
quotes and it has made no difference.

Thanks!
Dennis
 
Try to use a double quotes around the "|".
Update ProductInfo Set ProductInfo.TagValue
= "Choice1|Choice2" Where ProductInfo.TagName
= 'MEBChoices'
 
Unfortunately this is legacy software and I am using
Access 95 for this database. The call is made using DAO
3.51 from a VB app.
 
I do not know if this will work or not.
But have you try to use "\" before the pipe.
Like this,
Update ProductInfo Set ProductInfo.TagValue
= "Choice1\|Choice2" Where ProductInfo.TagName
= 'MEBChoices'

Try in single or double quotes. Usually the backslash "\"
will force to treat the character as a "normal" character.
 
I think maybe access 95 and DAO 3.51 have some compatible issue? for DAO 3.5
is later than access 95 and access 95 does not know it?
 
Back
Top