Squall_FF8 1 Posted 16 hours ago (edited) Hi guys, I have a TFDQuerry connected to MSSQL that returns a record with field Test - nvarchar(max). I would like to be able to Paste a text from Word in a RichEdit and be able to save it (formatted as RTF) in Test and latter on load it from there. How I can do that? (code snippet) P.S. If possible I try to use Insert/Update statements, but if I have to - I will use BLOBs. I just dont understand how blobs work in conjunction with normal Insert/Update. Edited 16 hours ago by Squall_FF8 Share this post Link to post
Remy Lebeau 1604 Posted 14 hours ago (edited) RTF is encoded in plain ASCII text, where non-ASCII characters are escaped. So, you should not need a blob for this, a simple text field will suffice (although, you might consider a blob if you want to store the RTF using 8bit characters but don't want to use varchar instead of nvarchar). Have you tried simply saving the RTF from the RichEdit into a UnicodeString (ie nvarchar) or AnsiString (ie varchar) variable and then load it back in, without involving a DB at all? Set the RichEdit.PlainText property to false to tell the RichEdit to act on RTF, and then use the RichEdit.SaveToStream() and RichEdit.LoadFromStream() methods to get and load the RTF. You can then expand on that logic to introduce text handling with a DB. Edited 14 hours ago by Remy Lebeau Share this post Link to post