|
|
Home » U++ Library support » U++ SQL » SQLArray + Like() + Accents problem
SQLArray + Like() + Accents problem [message #30791] |
Sun, 23 January 2011 00:38 |
alex100
Messages: 118 Registered: November 2007
|
Experienced Member |
|
|
Hi all
Suppose the clients table (SQLite) has the following contents on field (column) name:
Júlio Ferraz
Júlia Sotinova
Jusefina Braz
Jumila Carter
Now, I want to select names by using the first two chars.
I used a SQLArray (named dbgrid) and I am using the query() method to issue the Where clause.
I am formating the where clause like this:
(Supose strIniciais String variable has the contents of an editbox used to read the two characters)
SqlBool where1;
where1 = Like(Name,Format("%s%s%%",strIniciais.Mid(0,1),strIniciais.Mid(1,1)));
dbgrid.SetOrderBy(Name);
dbgrid.Query(where1);
If I write Ju in editbox the SQLArray shows
Jusefina Braz
Jumila Carter
which is correct.
If I write Jú (u with an accent) in editbox the SQLArray shows nothing.
Why?
I used a client GUI for SQLite, I opened the database and issued the following SQL statment:
Select * from clients where Name like 'Jú%';
(u with an accent)
and it worked. So it seems that the problem is on UPP c++ code.
Any help?
Thanks a lot
Alex
|
|
|
|
|
|
|
|
Re: SQLArray + Like() + Accents problem [message #30899 is a reply to message #30867] |
Fri, 28 January 2011 01:36 |
alex100
Messages: 118 Registered: November 2007
|
Experienced Member |
|
|
Well, it stoped from work again. IT just works while I have a free SQLITE GUI application used to launch sql statments to the db. It seems that this application temporarly modifies the SQLITE engine, i dont know how...
But I realized that SQLITE do not supports unicode on Like() statement. (http://www.sqlite.org/faq.html and search for unicode)
Someone wrote a .h and .c file to add support for unicode to SQLITE. the files are here:
http://ioannis.mpsounds.net/blog/2007/12/19/sqlite-native-un icode-like-support/?dl=sqlite3_unicode.zip
With this zip we can compile a .lib, a .dll or use the files directly on a project. As far as I realized, when using directly on a project, only the .c is needed.
I added the .c file to the project and called the functions
sqlite3_unicode_load();
sqlite3_unicode_free();
in the GUI_APP_MAIN block.
The project compiles well but when linking it does not finds the implementation of those functions.
How can I include this .c file in my project and call the functions? A little sample program would be very appreciated.
I tried also generate the lib file but compiler always says that it cant find ~
sqlite3_unicode_load();
sqlite3_unicode_free();
event specifying the .lib file.
Thanks
Alex
|
|
|
Goto Forum:
Current Time: Sun Jun 16 16:27:35 CEST 2024
Total time taken to generate the page: 0.02537 seconds
|
|
|