Database and Richedit Component lazarus / 16-Databases ---------------------------------------------------------------------- manhu · 2015-09-18 09:08 Hi I searched quite a lot for a Richedit Component where i can access the Database directly. I found lzRichEdit, RichMemo and also KMemo but with no Database Access. I now that i can load the Memofield with a Stream but since i use quite a lot of Memofield's i taught i would be more confined to do it "directly". I did found a RichMemo "clone" from CodeTyphoon pl_RichMemo but it seams like it does not work. Thanks for any Suggestions. Manfred ---------------------------------------------------------------------- exdatis · 2015-09-18 10:12 TDbMemo? ---------------------------------------------------------------------- rvk · 2015-09-18 10:48 Quote from: exdatis on September 18, 2015, 12:12:15 pmTDbMemo? TDBMemo doesn't do richedit (rtf). @manhu, do you need richedit or will just text (memo) do? ---------------------------------------------------------------------- manhu · 2015-09-18 11:21 I should have richedit ---------------------------------------------------------------------- rvk · 2015-09-18 12:24 I'm also very surprised there isn't a DB aware RichMemo component yet for Lazarus in the default installation. You could try TDBRichMemo from here: http://forum.lazarus.freepascal.org/index.php/topic,26810.msg167231.ht ml#msg167231 I had no problem installing this together with the RichMemo package: http://wiki.freepascal.org/RichMemo#Download ---------------------------------------------------------------------- manhu · 2015-09-18 13:02 Hi rvk tanks for your Idea.  Did successfully install the TDBRichMemo but i do not get any content from the Memo filed in the DB. I i chose a normal Textfiled in the DB, then it is displayed. Any Idea? ---------------------------------------------------------------------- rvk · 2015-09-18 13:14 For me it worked perfectly (Laz1.5 but 1.4.2 should work too, Windows 10 with Firebird 2.1 database and TIBConnection/TSQLQuery). What DB are you using and what DB-components? And how did you create the RichEdit-text-field in your DB? It shouldn't be TEXT but BLOB (or something similar for your DB- engine). (and who and how was the field originally filled in?) i.e. Code: [Select]CREATE TABLE TESTTABLE (   ID       BIGINT,   TEKST    BLOB SUB_TYPE 0 SEGMENT SIZE 80 ) ---------------------------------------------------------------------- manhu · 2015-09-18 14:09 I use this Environment: - MySQL - RemObject DataAbstract - The Field is a mediumtext Field - The Field was Filled with a Delphi Programm with a CopyCat Komponent In phpMyAdmin the Field looks normal. ---------------------------------------------------------------------- rvk · 2015-09-18 14:23 Quote from: manhu on September 18, 2015, 04:09:50 pmIn phpMyAdmin the Field looks normal. What do you mean by "normal"? Does it contain {\rtf1\ansi\ at the beginning? Or does phpMyAdmin have a richedit component (which I would find very surprising)? I not sure mediumtext may/can not contain RTF code for formatted text. So I'm not sure what you are "seeing" in phpMyAdmin. ---------------------------------------------------------------------- manhu · 2015-09-18 14:32 Sorry for being unclear QuoteWhat do you mean by "normal"? Does it contain {\rtf1\ansi\ at the beginning?Of course i meant that.  Quote{\rtf1\ansi\ansicpg1252\deff0\deflang2055{\fonttbl{\f0\fnil\fchar set0 Tahoma;}} \viewkind4\uc1\pard\f0\fs16 dfgdfg\par } � In a DBEdit it also look that way. ---------------------------------------------------------------------- skalogryz · 2015-09-18 14:58 Quote from: rvk on September 18, 2015, 03:14:32 pmIt shouldn't be TEXT but BLOB (or something similar for your DB-engine). (and who and how was the field originally filled in?) Oddly enough, it seems like it. If the field is not BLOB it would not load rtf. (the check for .IsBLOB in most of TDBRichMemo methods). Adding TDBRichXXXX component to the default LCL components package requires a full-time maintainer ---------------------------------------------------------------------- rvk · 2015-09-18 15:37 There are just 3 .IsBlob checks in dbrichmemo.pas. So adding "true and " in front of the check will always result in being true. Easy enough to check if it works after that. But (in Delphi/Firebird) I've always used BLOB for RTF-data. Code: [Select]    if (true and DataLinkField.IsBlob) then begin ...   if not FDBMemoLoaded and (FDataLink.Field<>nil)   and (true and FDataLink.Field.IsBlob) then begin ...   if FDBMemoLoaded and (FDataLink.Field<>nil)   and (true and FDataLink.Field.IsBlob) then begin Of course you could also completely remove the .IsBlob check but this way you can see what you've done ---------------------------------------------------------------------- manhu · 2015-09-18 20:56 Thank you for your advice. Will try that on Monday. Shalom Manfred ---------------------------------------------------------------------- Zoran · 2015-09-19 09:00 rvk, you actually mean "true or", don't you? Because, (true and DataLinkField.IsBlob) will return the same as DataLinkField.IsBlob. ---------------------------------------------------------------------- rvk · 2015-09-19 10:46 Quote from: Zoran on September 19, 2015, 11:00:04 amrvk, you actually mean "true or", don't you? Woops, yes (true), I do of course  Code: [Select]    if (true or DataLinkField.IsBlob) then begin ...   if not FDBMemoLoaded and (FDataLink.Field<>nil)   and (true or FDataLink.Field.IsBlob) then begin ...   if FDBMemoLoaded and (FDataLink.Field<>nil)   and (true or FDataLink.Field.IsBlob) then begin Thanks (I must have been momentarily blind there  ).