1. Stan Busk
  2. Valentina Database ADK
  3. Пятница, Апрель 06 2018, 03:05 PM
  4.  Подписаться через email
I have two problems:

1.- How do you make all your queries case-insensitive database-wide? The code I used in the past that worked fine with V4RB 4.7 no longer works (at all).

2.- How can you make all your queries ignore accentuated characters database-wide? I mean, how to treat 'å', 'à', 'á' and 'â' as 'a' for example.

Thanks!
Stan
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Hi Stan,

which old code you did have? Please copy paste it.
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
This is the old code that no longer works:

Public Sub Database_SetFormats(inDatabase As VDatabase)

Call inDatabase.SqlExecute( "SET PROPERTY WarningMode TO FALSE" )

If TargetMacOS then
inDatabase.LocaleName = "en_US" // http://userguide.icu-project.org/locale | http://php.net/manual/en/class.locale.php (e.g. fr_FR, de_DE, ru_RU )
else
'inDatabase.LocaleName = "en_US_POSIX"
end if

inDatabase.CollationAttribute( EVColAttribute.kStrength ) = EVColAttributeValue.kPrimary // Ignore case and accents when searching and sorting ( OR: SET PROPERTY Strength OF DATABASE TO 'kPrimary')
inDatabase.DateFormat = EVDateFormat.kMDY // MM/DD/YY
inDatabase.DateSep ="/"

End Sub
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Hi Stan,

* your code looks correct.
* we did not make any changes in this area.
* all our tests 100% positive.

So lets learn more deeply.

- why you think it not works? What exactly not works?
- you must be able open your db in Vstudio and see that property of DB are as you assigned them in the above code. You should be able do queries in VStudio and see expected results.

TIP: regular problem of V4RB users - they forget update V4RB plugin to the same version as vcomponents are.
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
You will find attached a very simple Xojo project, you just need to press the 'Perform Queries' button. I guess my queries are correct... The issue seems to come from using LIKE '%text%', I believe the 3 first queries should return the same amount of records and the 2 last queries as well...
Вложения
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
"The external item 'moValentinaTools' could not be found"
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
Here is the file with the library.
Вложения
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
It seems I need an existed database (TESTdb.icash) to run the app.
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
The first file I submitted includes the TESTdb.icash database, the second file is just the Xojo project with the missing library.
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
You should use "iLIKE" instead of "LIKE" to employ collator settings ("LIKE" is mostly ignore them for speed purpose).
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories