Click to See Complete Forum and Search --> : how to put (") inside an asp variable of type string


jyb
07-08-2002, 11:34 AM
hey there,
i`ve searched far and wide for a way to allow a (") inside a variable. Example:
<% x="WHERE " &y " =0 ORDER BY ID" %> ^and ^
The 2 (")`s that I have marked with ^`s above is where the problem lies,
(")`s in the middle of the variable. I have to do this as you might have
guessed, to generate SQL code from asp. It doesn`t generate the proper html,
and usually causes an error. Does anyone know a way around this ?

THANX. JYB

Kris Eiben
07-08-2002, 12:19 PM
Literal strings are normally delimited by single quotes (apostrophes) in
SQL. If there is a double quote within the literal string, escape it by
doubling it ("").

"jyb" <jybedard@programmer.net> wrote in message
news:3d29b0ec$1@10.1.10.29...
>
> hey there,
> i`ve searched far and wide for a way to allow a (") inside a variable.
Example:
> <% x="WHERE " & y " =0 ORDER BY ID" %> ^and ^
> The 2 (")`s that I have marked with ^`s above is where the problem
lies,
> (")`s in the middle of the variable. I have to do this as you might
have
> guessed, to generate SQL code from asp. It doesn`t generate the proper
html,
> and usually causes an error. Does anyone know a way around this ?