Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2004, 10:15 AM
Authorized User
 
Join Date: Feb 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retaining RichTextBox Format in Database

Hello,

I am having a problem to have the formatting of my rich Text Box in a Form to be retained when I do an Insert Into Sql Statement.

The text in the RTB is saved in the Access Database but alle the Bold Face, Underline, etc... is lost when I call back the saved text from the database.

Any solution to help me with this problem?

Mark

 
Old February 25th, 2004, 02:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I assume you are using something like:

[column1] = RichTextBox1.Text

Try:

[column1] = RichTextBox1.Rtf
 
Old February 25th, 2004, 02:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Sorry, that was for VB.Net. I don't use VB6 very much but I think the code would look like this:

[column1] = RichTextBox1.TextRTF

J
 
Old February 25th, 2004, 02:44 PM
Authorized User
 
Join Date: Feb 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Putting it is just an insert into Table (Column) Values (RichtextBoxNotes.TextRtf)


Pulling the data is done like this:

Set FormBonCommande.RichTextBoxNotes.DataSource = RsTitre2
FormBonCommande.RichTextBoxNotes.DataField = "Description"

FormBonCommande.RichTextBoxNotes.TextRTF = RsTitre2.Fields("Description").Value

This still does not work.

 
Old February 25th, 2004, 03:06 PM
Authorized User
 
Join Date: Feb 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think I might have found a solution. I can use the MEMO field instead of OLE Object in the database or Plain TExt to retain the format of the RichTextBox.

However with MEMO I am limited with 65,000 characters in the RTB.

Thanks for your advices and if you get anything better let me know.

Mark






Similar Threads
Thread Thread Starter Forum Replies Last Post
Access database database format itHighway Access 0 February 24th, 2008 06:34 PM
Format retaining... rupen Crystal Reports 0 April 4th, 2007 01:35 PM
Unrecognized Database Format Apocolypse2005 Beginning VB 6 2 September 29th, 2006 11:35 AM
Unrecognised database format ppenn Access 0 November 18th, 2004 06:59 AM
RichTextBox with Access Database kooltmd VB How-To 1 April 21st, 2004 06:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.