Code used to save the data from the ListBox into a SQLite Data Base file:
SQL_Record = "INSERT INTO List (Issue, Main_Title, Release_Date, Bar_Code_Label) VALUES " +_
"('" + LB.Cell(LoopIdx,0) + "','" + LB.Cell(LoopIdx,1) + "','" + LB.Cell(LoopIdx,2) + "','" + LB.Cell(LoopIdx,3) + "')"
Code used to read data from the SQLite Database / add data into a ListBox:
LB.AddRow(OpenRS.IdxField(2).StringValue, OpenRS.IdxField(3).StringValue, OpenRS.IdxField(4).StringValue, OpenRS.IdxField(5).StringValue, OpenRS.IdxField(3).StringValue)
The ‘’ character is not displayed as is, but as a three character set <?><?><?>
A Copy of a row with this data into a TextEdit document reveal the right sentence (with the correct character). This is an Encoding problem only.
I tried:
OpenAtom = OpenRS.IdxField(5).StringValue
Open.Append OpenAtom.ConvertEncoding(Encodings.UTF8)
and:
Open.Append OpenRS.IdxField(2).StringValue.ConvertEncoding(Encodings.UTF8)
then (both cases above):
OpenAtom = Join(Open,Chr(9))
LB.AddRow Open
But the text still loose an Encoding (as far as I can understand reading what I got in the ListBox).
How can I get the correct encoding ?
PS: the code comes from the Language Reference.
BTW: if youare asking yourself why I started with IdxField(2) in OpenRS.IdxField(2).StringValue
it is because IdxField(1)
returns the value of the Primary Key
. I have nothing against that, but I only wanted to get the real data as I stored them in the SQLite data base file.
The example from Database.SQLExecute
was taken to create the table.
The other example - INSERT INTO
above - comes from SQLiteDatabase
.
Of course, this is preliminary coding and will be changed later (once I know I can achive my needs using SQLite as a data storage): I do not even create all fields / tables for my (future) need.
One of the changes is to use the Field Names instead of IdxField().