FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Richedit problem SOLVED
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Richedit problem SOLVED
Posted: Fri Nov 19, 2021 05:19 PM
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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Richedit problem
Posted: Sat Nov 20, 2021 08:25 PM

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
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Richedit problem
Posted: Mon Nov 22, 2021 08:56 AM

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

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Richedit problem
Posted: Mon Nov 22, 2021 10:20 AM
How are you importing into MySql.
If you import using FWH built-in MySql library you may not have problems.

Code (fw): Select all Collapse
oCn := maria_Connect( <server>, <database>, <user>, <password> )
oCn:ImportFromDBF( cFileDBF, cTableName )  // creates new table and imports data
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Richedit problem
Posted: Mon Nov 22, 2021 10:25 AM

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

Continue the discussion