Richedit problem SOLVED

Post Reply
User avatar
Maurizio
Posts: 827
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Richedit problem SOLVED

Post 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
Last edited by Maurizio on Mon Nov 22, 2021 10:25 am, edited 1 time in total.
User avatar
cnavarro
Posts: 6558
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Richedit problem

Post 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.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Maurizio
Posts: 827
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Richedit problem

Post 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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Richedit problem

Post 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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Maurizio
Posts: 827
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Richedit problem

Post 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
Post Reply