Subject |
Re: applyLocate and apostrophe applylocate limit ? |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Mon, 19 Aug 2024 13:13:21 +0200 |
Newsgroups |
dbase.getting-started |
On 2024/08/19 12:44, Akshat Kapoor wrote:
> Are you using dbf tables or some RDBMS.
> for some reason
>
> form.rowset.applyLocate( "CITY = 'O\'Grady'" )
>
> failed to work on my system.
> Plus 12.3 MariaDB on Windows 10
As far as I know, Dirk is using .dbf tables.
Both form.rowset.applyLocate( "CITY = 'O\'Grady'" ) and
form.rowset.applyLocate( "CITY = [O'Grady]" ) will work with .dbf
tables. It is, however, less hassle to use the square brackets than to
have to introduce an add_escape() function to the code.
When it comes to the applyLocate() method of an ADOrowset dBASE seems to
be trying to bring some measure of "proper" SQL into the equation and it
will only accept single quotes to delimit literal strings e.g ("CITY =
'O'Grady'" which, of course, gives an error. A bit of Googling suggests
that for MariaDB both ("CITY = 'O''Grady') and (CITY = '\'Grady') should
work.
Mervyn.
|
|