Page 1 of 1

NeoBookDB search *?

PostPosted: Thu Mar 05, 2015 6:34 am
by mishem
When looking for a team dbfQuery characters *? the message type "query syntax error".

What is interesting ... Individually, * and ? finds no problems. This combination of +? also no problem.

Maybe there is a solution how to find *? ....

Re: NeoBookDB search *?

PostPosted: Thu Mar 05, 2015 7:16 am
by Gaev
mishem:

Can you post a copy of the exact dbfQuery command you are trying to use ?

Maybe there is a solution how to find *?

Perhaps you can try placing an exclamation point ! at the start of the "filter" parameter value (in case NeoBook is trying to do a multiplication)

Also, try and replace * and ? with their respective [#xx] values.

Re: NeoBookDB search *?

PostPosted: Thu Mar 05, 2015 8:28 am
by mishem
Code: Select all
SetVar "[Result]" "[#42][#63]"
dbfQuery "[PubDir]Regex.dbf" "REGEX==[#34][Result][#34]"

I tried ....
And the exclamation point, and codes [#xx] ...
Generally events are as follows:
In ListBox1 selected item. At this point is the symbol "*?". Searched in the database field with these symbols .....

Re: NeoBookDB search *?

PostPosted: Thu Mar 05, 2015 10:59 am
by Gaev
mishem:

Yes, dbfQuery does NOT like the combination of *? in the filter parameter ... in fact * followed by any character.

Not a perfect solution ... but here is how you might get around it ...
Code: Select all
 dbfQuery "[PubDir]Regex.dbf" "REGEX*[#34]*[#34] AND REGEX=[#34]?[#34]"

Note:

1) * is an undocumented comparator ... means "begins with"

2) will also return something like *abcd? ... so you may have to loop through the returned results to exclude such records ... but if you need to view the results in a Grid, it won't help.

The only other thing I can think of is to "store a substitute value for * in your database" ... :-( ... e.g. _asterisk_ ... something that is not likely to be otherwise contained in this field.

Re: NeoBookDB search *?

PostPosted: Thu Mar 05, 2015 11:21 am
by mishem
Gaev wrote:
Code: Select all
 dbfQuery "[PubDir]Regex.dbf" "REGEX*[#34]*[#34] AND REGEX=[#34]?[#34]"


An excellent option. I had not thought about it. Thanks.