Source language: Translate to:

dbpQuery

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

dbpQuery

Postby phenix37 » Wed Jul 30, 2008 3:07 pm

Hello all,

I'm trying to use this code:
Code: Select all
 dbpQuery "[base_id]" "[choix_dans_liste_table]" "[Choix_champs] LIKE [#34]%[texte_chercher]%[#34] [ORAND] [Choix_champs2] LIKE [#34]%[texte_chercher]%[#34]"

With the content of variables:
Code: Select all
 dbpQuery "base_id" "TABLE" "FIELD1 LIKE "%text_to_word%" OR FIELD2 LIKE "%text_to_word%" "

But it does not work.
Where do I commit a mistake?
Thank you.
phenix37
 
Posts: 107
Joined: Thu Apr 20, 2006 6:31 pm

Postby Gaev » Wed Jul 30, 2008 4:06 pm

Geo:
But it does not work.
You do not say what actually happened ? ... did NeoBook return an error ? ... were zero records selected ? ... were all records selected ?

Code: Select all
dbpQuery "base_id" "TABLE" "FIELD1 LIKE "%text_to_word%" OR FIELD2 LIKE "%text_to_word%" "

a) I am assuming the double quotes at the very end is just a typographical error on this forum article ... and not in your pub.

b) Did you try and use this "hard coded' version of the command ?

c) Your Table is called "TABLE" ? ... this is a reserved word ... try using another name e.g. Table1

d) LIKE "%text_to_word%" ... please note that the underscore is a wild card character ... from the Help file ...
Code: Select all
Another wildcard is the underscore character (_) which can be used to represent any single character. For example:

LastName LIKE "sm_th"

will find "Smith", "Smyth", "Smath", "Smeth", etc.
... hopefully you are looking for content matching ...

"any number of characters"
... followed by the exact text string "text"
... followed by "any one character"
... followed by the exact text string "to"
... followed by "any one character"
... followed by the exact text string "word"
... followed by "any number of characters"
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

dbpQuery

Postby phenix37 » Wed Jul 30, 2008 4:45 pm

thank you Gaev.
I badly expressed.
I have this command. Pub
Code: Select all
dbpQuery "[base_id]" "[choix_dans_liste_table]" "[Choix_champs] LIKE [#34]%[texte_chercher]%[#34] [ORAND] [Choix_champs2] LIKE [#34]%[texte_chercher]%[#34]"


I use variables that are assigned previously.
The result seems to ignore the 2nd assertion.

If I'm looking for a value in the first field and the second with the operator OR
The result does not return records of the second operator.

Here is an example of the search page.
phenix37
 
Posts: 107
Joined: Thu Apr 20, 2006 6:31 pm

Postby Gaev » Wed Jul 30, 2008 5:27 pm

Geo:
If I'm looking for a value in the first field and the second with the operator OR
The result does not return records of the second operator.

In your pub, you have ...
Code: Select all
if "[exact_contient]" "=" "Contient"
 if "[case_champs2]" "=" "Checked"
    dbpQuery "[base_id]" "[choix_dans_liste_table]" "[Choix_champs] LIKE [#34]%[texte_chercher]%[#34] [ORAND] [Choix_champs2] LIKE [#34]%[texte_chercher]%[#34]"
 else
    dbpQuery "[base_id]" "[choix_dans_liste_table]" "[Choix_champs] LIKE [#34]%[texte_chercher]%[#34]"
 endif
endif


You have a CheckBox object named Case_champs2 ... but its Variable: (to store button status) is [champs2] !!! ... so the second dbpQuery command is serviced ... not the first !!! ... so, either change the name of the associated variable ... or change the variable referenced in the second If command.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby phenix37 » Thu Jul 31, 2008 12:59 am

Gaev wrote:Geo:
You have a CheckBox object named Case_champs2 ... but its Variable: (to store button status) is [champs2] !!! ... so the second dbpQuery command is serviced ... not the first !!! ... so, either change the name of the associated variable ... or change the variable referenced in the second If command.


Hello Gaev.

Excellent!
What error inattention!
Thank you very much.
phenix37
 
Posts: 107
Joined: Thu Apr 20, 2006 6:31 pm


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest