Re: Vertical bar in SQL statement



It's an extended character, so you need to use the asc("|") function
to find out the code, which is 124. Then concatenate chr(124) into the
string.

-Mary

On Mon, 14 May 2007 08:24:00 -0700, JamesFielding
<JamesFielding@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi guys,

Okay, I know this is going to be an easy one... but I just can't work it
out.

I'm using Jet to connect to an Access database, and want to add data
to a table, containing a vertical bar | character in it.

INSERT INTO tblSomething (TextField) VALUES ('What a || lovely day')

(i.e. I want to insert a piece of text which reads What a || lovely day...
I don't want SQL to do anything clever with this.)

I can't do it.

I just keep getting error messages as Jet seems to be interpreting
the bar, rather than just inserting it as part of the INSERT command.

If I use the same command in, say, SQLCE, it works a treat.
Does anyone know how to get around this issue ?


James
.