I do not know why, but I was sure you will ask just that.
In the mean time, I checked here with a code example that uses a SQLite db (it creates the file, add a TABLE and save a Record).
the Euro character (€) is saved and read correctly without setting an encoding.
For the record, here’s the Xojo Code I (re-)used:
Var db As New SQLiteDatabase
Var DB_FI As New FolderItem("FG_DB.sqlite")
// Set the FolderItem to the db Reference
db.DatabaseFile = DB_FI
Try
db.CreateDatabase
Catch Error As DatabaseException
MessageBox "Unable to create the Data Base file."
Return
End Try
If db.Connect Then
// Add a TABLE And Rows
Var sql_Cmd As String
sql_Cmd = "CREATE TABLE IF NOT EXISTS Employee(" +_
"Name_First TEXT, " +_
"Name_Last TEXT, " +_
"Job_Title TEXT, " +_
"Job_Salary Text, " +_
"Employe_ID TEXT, " +_
"Employe_Photo TEXT, " +_
"Employe_Entry_Date DATE, " +_
"ID INTEGER NOT NULL, PRIMARY KEY(ID));"
Try
db.BeginTransaction
// Add the TABLE
db.ExecuteSQL(sql_Cmd)
db.CommitTransaction
Catch error As DatabaseException
MsgBox("Database error: " + db.ErrorMessage)
db.RollbackTransaction
End Try
// Add a Row
Var row_DBR As New DatabaseRow
// Fill the row
row_DBR.Column("Name_First") = "Federico"
row_DBR.Column("Name_Last") = "Giannetti"
row_DBR.Column("Job_Title") = "DB Developer"
row_DBR.Column("Job_Salary") = "20,000 €"
row_DBR.Column("Employe_Entry_Date") = "2016-08-16" // Added for FG
Try
db.AddRow("Employee", row_DBR)
Catch error As DatabaseException
MessageBox("(AddRow) DB Error: " + error.Message)
End Try
Else
MsgBox("Unable to open the Data Base File. Error: " + db.ErrorMessage)
End If
You can put this code in a PushButton and run: it will create a file named “FG_DB.sqlite
”.
For reading, it is a different matter (I used a custom application).
This will not sole your problem, but you know it is posssible to Write and Read all characters (EURO as asked €) to a data base using Xojo.
Now, you have to search in your Xojo code where and how you read and write to the MS-Access db. There lies the trouble. More specifically, probably when you use the ODBC driver (you use an ODBC driver to talk to MS-Access, right ?)
The provided code:
rows2.Column(“Descrizione”).StringValue=textMessaggio.text
Is probably where you have to set the encoding (if it is not set in the Driver / MS-Access db.
The entry to read in the documentation is: TextEncoding
I do not have MS-Access to make test (i never used that sofrtware), sorry.