Richedit problem SOLVED

Richedit problem SOLVED

Postby Maurizio » Fri Nov 19, 2021 5: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
Last edited by Maurizio on Mon Nov 22, 2021 10:25 am, edited 1 time in total.
User avatar
Maurizio
 
Posts: 823
Joined: Mon Oct 10, 2005 1:29 pm

Re: Richedit problem

Postby cnavarro » Sat Nov 20, 2021 8: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Richedit problem

Postby Maurizio » Mon Nov 22, 2021 8: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
User avatar
Maurizio
 
Posts: 823
Joined: Mon Oct 10, 2005 1:29 pm

Re: Richedit problem

Postby nageswaragunupudi » 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: Select all  Expand view

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
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Richedit problem

Postby Maurizio » 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
User avatar
Maurizio
 
Posts: 823
Joined: Mon Oct 10, 2005 1:29 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests