Topic: Sarch SQL very complex

Hello Dmitry

I've developped an application about wild flowers (MVD 152 with SQLLite).
All is OK, it works fine.

For differents requests (name, latin name, color ...) I use very simple SearchSQLs. They works fine.

To make them even more efficient queries, I try to use a more complex query.
It involves several combo boxes items. User can find a flower according to many choices picked up in comboboxes.
He can find a flower with such a color AND such a toxicity AND such a distribution AND son on.

Early in the SQL I define the fields of different tables I will use.
I define alson all left join tables.

At the end, after clause Where, I use the syntax calling all my comboboxes
(i.e part of my code :

(Tailles.Taille like '%{ComboBox4}%')AND
(Types.Type like '%{ComboBox2}%')AND
(Milieux.Milieu like '%{ComboBox3}%')AND
(Petales.Petale like '%{ComboBox7}%')AND
(Couleurs.Couleur like '%{Combobox1}%')AND
(Inflorescence.Inflo like '%{ComboBox12}%')AND
(Forme_Feuille.Forme like '%{ComboBox9}%')AND
(Contour_Feuille.Contour like '%{ComboBox10}%')AND
(Disposition_Feuille.Disposition like '%{ComboBox11}%')AND
(Floraison.Periode like '%{ComboBox6}%')AND
(Protection.Protegee like '%{ComboBox14}%')AND
(Toxicites.Toxicite like '%{ComboBox13}%');

Code of SearchSQL is behind a button (Button OK).

Nothing happend.

Is SearchSQL limited by certain numbers of operator AND ?
What is wrong in my code ?

Thanks for you help

JB

Re: Sarch SQL very complex

There is no any limits but I see that you incorrent use ComboBox in the query.
Should be

(maintable.id_Taille = {ComboBox4}) AND...

Why you don't use more simple button with action "Search" ?

Dmitry.

Re: Sarch SQL very complex

Hello Dmitry

After correcting syntax of my Search SQL, it works fine.
I've also try with a simple Search behind a button, it also works fine.
But as the implementation is easier, I've chosen the latter method.

Thanks again

JB