Saving Strings with newlines to sqlite

Hi all,
Real simple (or is it) question.
I am still using real studio 2012 v1.1.

I am simply trying to save textarea contents with newlines in to a sqlite database.
ie:
my name
is jim

however when reloaded back into a text area I get:

my name is jim

What is the most efficient way of acheiving this, any ideas?

Thankyou

Try this:
For writing the edited data in the the textarea back to the field in the database.
Using RTFValue

SqlTekst = “UPDATE brief SET tekst = '” + DoelTextArea.StyledText.RTFData + “’ WHERE ID=” + mHuidigKlantID
DBName.SQLExecute(SqlTekst)

You database field must be a blob type.
More see this link

Hi Horst

Saving the rtf data to the sqlite database worked…
THANKYOU :slight_smile:

How would I now convert that data imported from db to the textarea?

I have tried

dim sql as String = "select * from myTable "
dim result as RecordSet = myDB.SQLSelect(sql)
TextArea2.TextStyleData = Result.Field(“myText”).StringValue

Aha got it

TextArea2.StyledText.RTFData =Result.Field(“myText”).StringValue

Thankyou Horst for your reply
J :slight_smile:

Will it possible to save a multiline TextArea without RTF-Code (much cleaner, if you don’t need formatted Text) into a Blob? Like this:
Pseudo

[code]Line 1 with Content

Third line[/code]
Maybe via \ ?
Result

[code]Line 1 with Content\

\

Third line[/code]
The new Xojo-Framework JSON-Class saves line breaks via \ and Tabstops via \\t.