Saving Rich Text box in DB...

rlangi05

Member
Joined
Jan 2, 2006
Messages
21
Programming Experience
1-3
If I want to save the contents of a rich text box to a database, what type of field should it be saved in? I'm using an Access database. I don't think the text field would be sufficient cuz that only saves in text format right... How about the Memo field type, would that be ok? I'm using a rich text box because I copy paste formatted text (with bullets and tables) from MS Word to the rich text box and then I want to save it to a database. But I'm not sure what field datatype to use so I won't loose any of the formatting.

Please help.
 
Text field is too small only 255 chars, memo limits to 64.000 chars so this could be it, then you got OLE object field limit to 1GB.

The formatted text in the RichTextBox (RTB) is of type Rich Text and that is your text strings with special formatting codes embedded. Do have a look at your RichTextBox.rtf property and you will see what I'm talking about. It's kind of like Html - get it?

So if memo string length is sufficient, use that, else go for OLE object. Either way, you save RTB.rtf to preserve the formatted text, and also put it back to RTB.rtf when retrieving from DB.
 
Read the DW2 link in my signature.. start with Creating a Simple Data Application, and then read Saving Changes to a Database
 
thank for your answer, but i need know how i can save the content of richtextBox in memo column, when i save display an error.
how can i give format to richtextbox.rtf for save in that column?

sorry, i don`t nkow more ingles....
 
Back
Top