Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I load a database field into a RichTextBox Control?

Status
Not open for further replies.

Lekar

Programmer
Sep 7, 2001
85
CR
Hi!
I want to load the data that is located in a database field into a RichTextBox Control. I open a recordset in the Form_Load event and then I assign every field to a respective object. Everything works well, but when I assign the contents of the field into the RichTextBox Control,
using for example: RtbLetra.TextRTF = rsCancion("Letra") ,
it displays something like this:

{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss Arial;}{\f3\fswiss Arial;}{\f4\fswiss\fprq2 Arial;}}
{\colortbl\red0\green0\blue0;}
\deflang3082\pard\plain\f4\fs20\b \{\\rtf1\\ansi\\deff0\\deftab720\{\\fonttbl\{\\f0\\fswiss MS Sans Serif;\}\{\\f1\\froman\\fcharset2 Symbol;\}\{\\f2\\fswiss Arial;\}\{\\f3\\fswiss Arial;\}\{\\f4\\fswiss\\fprq2 Arial;\}\{\\f5\\froman\\fprq2 Times New Roman;\}\}
\par \{\\colortbl\\red0\\green0\\blue0;\}

...

I have tried with the Text and .TextRTF, but its displays the same text.
How can I change that cryptic text into the corresponding text?

Thanks in advance.
 
maybe try to assign the fields of the db to string variables first, then assign the string variables to the rtb. since you have embedded formatting assigned to the rtb from the db, you need to strip the formatting out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top