[VNET] valentina sql
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Mar 25 17:09:17 CST 2004
On 3/25/04 4:58 PM, "Marcus Bointon" <marcus at synchromedia.co.uk> wrote:
Hi Marcus,
> I don't quite get what you mean about it not caring about double quotes. If
> I have a string like this:
>
> "Hello "abc" and 'def' (1)"
>
> I would expect it to be escaped thus:
> "Hello \"abc\" and \'def\' (1)"
Why you expect this ???
> But ValentinaEscapeString escapes it like this:
>
> "Hello "abc" and \'def\' (1)"
and this is correct Marcus.
1) You must use ValentinaEscapeString() only when you build query string
2) you escape only string constants
^^^^^^^^^^^^^^
For example:
SELECT
FROM
WHERE fld = 'string constant'
In your case this looks as SQL command
SELECT
FROM
WHERE fld = 'Hello "abc" and 'def' (1)'
^^^^^ problem
Note, that ONLY and ONLY single quotes cause problem inside of string
constant!!!
So we need escape only single quotes
SELECT
FROM
WHERE fld = 'Hello "abc" and \'def\' (1)'
So Valentina now can correctly determine where string constant ends.
You see?
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list