>Sorry, there's no escape character, but it's not needed, as far as I
>know.
>If you're wanting to create quotes in a string via Lingo, you can use
>QUOTE
>as in "my"&"E&"name""E&&"is Manny". If the quotes are in a
>string
>entered into a field by the user, you shouldn't need to escape them.
>
>Have you done tests with your database to test this?
Yep, I've tested it. In an SQL statement, strings have to be surrounded
by either single or double quotes. While single quotes are the standard,
the latter is often used. I've been a web database programmer for a
number of years and to get around this, an escape char is used when the
same quote/doublequote is found within the string. The SQL gets built as:
SQL="insert into myTable(NAME, SIZE) values('"&myName&"','"&mySize&"')"
which will only be a problem when the value of myName and/or mySize
contain the same char used to surround the string in the query, in this
case a single quote. The database sees this as the end of the string and
throws an error due to what it sees as bad syntax:
insert into myTable(NAME, SIZE) values('Bob O'Reilly','36L')"
using your example, "my"&"E&"name""E&&"is Manny", would give:
...values("my"name"is Manny",... where the " after my would be seen as the
end of the string.
In Perl and PHP, for example, this would be written "my\"name\"is Manny".
But, if there's no such creature as an escape char in Lingo, then I'll
just have to filter out the double quotes, as I think single quotes would
be more prevalent in this case. So, I'm using the QUOTES, but to surround
the strings in the SQL as I build the variable:
SQL="insert into myTable(NAME, SIZE) values(""E&"Bob
O'Reilly""E&",""E&"36L""E&)" which sends the db the
following:
insert into myTable(NAME, SIZE) values("Bob O'Reilly","36L")
I just need to watch for the double quotes in the MUI window when the user
enters the name. Which brings me back to my other question, for which
I've found no solution in my searches...How to set the value of an
#editText widget in a MUI window.
Thanks,
Mike
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL
PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping
with programming Lingo. Thanks!]