I have a SQLite database with a table “countries”. This table hast two fields:
serial INTEGER
country TEXT
In SQLite or Valentina Studio, this sql query works without any problem
SELECT serial, country FROM countries WHERE LOWER(country) = ‘österreich’
In my method this doesn’t work:
var RetValue as integer
var sql as string
var CountryName as String = “österreich” // or Ägypten for Egypt
sql = “SELECT serial FROM countries WHERE country =?”
Try
rows = myDB.SelectSQL(sql, CountryName)
If rows <> Nil Then
For Each row As DatabaseRow In rows
RetValue = row.Column(“serial”).IntegerValue
Next
rows.Close
End If
return RetValue
Catch error As DatabaseException
MessageBox(CurrentMethodName + ": Error: " + error.Message)
End Try
If the country name contains a German umlaut the query works.
Example:
Dänemark
Südafrika
Rumänien
If have tried to use “CountryName.ConvertEncoding(Encodings.UTF8)”, but this doesn’t help