How to show the letter "ñ" in queries with Sqlite

serch87

Member
Hi everyone, my question maybe is very simple but until now I don't know how resolve this situation.
I'm doing queries in Sqlite without any problems, until I do it with data with letter "ñ", don't show me the information correctly in an textbox for example I have "Yañes" and show me in the textbox "Ya?es" I don't know because this happens the data base are pass since mysql and there is problems with this data shown perfectly. (I'm sorry for my bad English)

I hope someone help me


SERGIO.


:sign0085:
 

Merlot2309

Active Member
Licensed User
Longtime User
Hello Sergio,

Is the data in your database itself correct?
Importing data from csv can cause the error with ñ, é, etc.

Just posted an example "Species translator" with source code in the topic: share your creations.
Maybe this is of any help.

Helen
 

serch87

Member
Hi Erel and Helen, this is the code that I used to show the data in the TextBoxes:

Sub BuscaCliente(cnt)
Connection1.BeginTransaction
Command1.AddParameter("cont")
Command1.SetParameter("cont", cnt)
Command1.CommandText="SELECT * FROM clientes WHERE num_contrato=@cont"
Reader1.Value=Command1.ExecuteReader

If Reader1.ReadNextRow=True Then
TextBox2.Text=Reader1.GetValue(1)
TextBox3.Text=Reader1.GetValue(2) <-- Here are the possible data with letter "ñ"
TextBox4.Text=Reader1.GetValue(4)
TextBox5.Text=Reader1.GetValue(7)
Else
Msgbox("No se encontaron datos")
TextBox1.Text=""
TextBox1.Focus
End If
Reader1.Close
Connection1.EndTransaction

contrato=TextBox1.Text

BuscaLectura(contrato)

TextBox1.Enabled=False
End Sub

I just need show the records, all the transactions are do in PHP with Mysql and after then passes the database into SQLite. MySQL shows the data correctly with letter "ñ".

Thanks for answering and I hope I can help me
(Sorry for my bad english)
 

agraham

Expert
Licensed User
Longtime User
Is this an Android question? That code looks like Basic4ppc!

It's probably yet another encoding problem. Whenever you see "?" instead of the correct character it's an odds on bet you have an encoding problem.

I don't know for sure as I don't use SQLite but I guess that the DataReader assumes UTF-8 encoded text which would be usual for a .NET object reading text from a file. The strings in your database are probably not UTF-8 encoded.
 
Last edited:

Merlot2309

Active Member
Licensed User
Longtime User
Hola,

You are working with B4PPC, not with B4Android, correct?
Maybe someone can move this thread to the B4PPC forum.

Noticed that I have the same problem in my B4PPC project and that the sorting order of values with special signs is not correct. I guess that this is a SQL error. Appears in both B4Android and B4PPC.
For example: Sé is shown after Su or Sw.

Helen.
 

serch87

Member
I change the question to the Basi4ppc forum.
thank you all for your help.
I'm sorry for post in the wrong forum.


SERGIO.
 
Top