SqlSelect doesn't find text in textfield
Markus Fraefel
markus.fraefel at futurestudios.ch
Mon Sep 22 07:27:34 CDT 2008
Thanks a lot, Ruslan!
It works now, as you described.
Regards,
Markus
-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] On Behalf Of Ruslan Zasukhin
Sent: Montag, 22. September 2008 12:53
To: valentina at lists.macserve.net
Subject: Re: SqlSelect doesn't find text in textfield
On 9/22/08 12:02 PM, "Markus Fraefel" <markus.fraefel at futurestudios.ch>
wrote:
Hi Markus,
> I work with Director and Valentina database and need to search
> Valentina database fields of type 'Text' and 'String' for a searchTerm
> that is entered by the user. This works fine as long as the
> searchTearm contains 1 word or a part of 1 word without any special signs.
>
> As soon as the searchTerm contains any special characters like (, %, ?
etc.
> the search doesn't find any records although there are database
> fields, that contain those characters.
>
> Also if the searchTerm contains 2 or more words (without special
> characters) the search doesn't find any records.
>
> I am using the following Lingo code:
>
> res = gDB.SqlSelect( "SELECT * FROM Seiten_de WHERE Lauftext LIKE '%"
> & searchTerm & "%'", #kServerSide, #kReadWrite, #kRandom )
>
> What is wrong with this code?
* you may need read in docs about IndexByWords flag of Valentina
then check your settings.
* to make work special chars as % inside of search terms you need to use
Valentina.EscapeString() on string from user
res = gDB.SqlSelect(
"SELECT * FROM Seiten_de WHERE Lauftext LIKE '%"
& EscapeString(searchTerm)
& "%'",
#kServerSide, #kReadWrite, #kRandom )
* about 2 words ... Should work if you use LIKE as written above.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information http://www.paradigmasoft.com
[I feel the need: the need for speed]
_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list