Page 1 of 1
Richedit problem SOLVED
Posted: Fri Nov 19, 2021 5:19 pm
by Maurizio
Hello Navarro
I use TRichEdit5
what is the difference between an RTF string starting with
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1040{\fonttbl
I have this in my DBF
and
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\f0\fs20
I have this in MySql , and are not compatible .
Regards Maurizio
Re: Richedit problem
Posted: Sat Nov 20, 2021 8:25 pm
by cnavarro
Dear Maurizio,
I don't think I understand your problem well
The problem is when saving in MySql an rtf file that contains that string?
Please explain better
If your problem is that when you retrieve it you cannot see the document correctly in the RTF viewer, it is because the RTF strings look like {\ rtf1 \ ansi \ .... When you try to send this string in your SQL statement, the backslashes they are sent directly to MySQL, which interprets them as escape characters and corrupts your data.
Re: Richedit problem
Posted: Mon Nov 22, 2021 8:56 am
by Maurizio
Navarro ,
thanks for your reply
The problem is that I imported the data from DBF into Mysql and also the RTF .
Now when I open the table in Mysql the RTF field is no longer readable.
Is there a method of transferring RTF fields from DBF to Mysql?
Maurizio
Re: Richedit problem
Posted: Mon Nov 22, 2021 10:20 am
by nageswaragunupudi
How are you importing into MySql.
If you import using FWH built-in MySql library you may not have problems.
Code: Select all | Expand
oCn := maria_Connect( <server>, <database>, <user>, <password> )
oCn:ImportFromDBF( cFileDBF, cTableName ) // creates new table and imports data
Re: Richedit problem
Posted: Mon Nov 22, 2021 10:25 am
by Maurizio
Navarro ,
I solved with a workaround , thanks for your help .
I have created an automatic cycle on the DBF
For each record I open a dialog by loading the field-> RTF in a get
I save it in the mysql field and close the dialog automatically.
and it works
Maurizio