473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Loading and saving an rtf file from mysql database

Hi Guys,

I'm doing some work with richtextboxes and want to be able to save and
load the content from them to a mysql database (including all
formatting). I figured the best way to do this would be to save the
contant of the rtb to an rtf file and then load the file into a mysql
BLOB field:

Public Sub savetoDB()

Dim mysqldb As ADODB.Connection = New ADODB.Connection
mysqldb.Open(".......connection string....")
mysqldb.Execute("INSERT INTO table123 (content) VALUES
("LOAD_FILE('C:/test.rtf'))")
mysqldb.Close()

End Sub

The problem is that I don't know any way to extract the rtf from the
BLOB field and place it back into the file. I've tried looking into the
mysql forums but I'm not getting much help. Any help you can provide
would be appreciated.

Thanks,
Waqas

Jan 15 '07 #1
2 5202
Wagaz,

In fact can you using this code do everything with any file that you want to
use as blob.

http://www.vb-tips.com/dbpages.aspx?...6-38b5a2f7fdf0

Have a look at the bottom, (as long as the pages are in reconstruction, this
for latter viewers of these pages)

Cor

<Wa**********@gmail.comschreef in bericht
news:11**********************@38g2000cwa.googlegro ups.com...
Hi Guys,

I'm doing some work with richtextboxes and want to be able to save and
load the content from them to a mysql database (including all
formatting). I figured the best way to do this would be to save the
contant of the rtb to an rtf file and then load the file into a mysql
BLOB field:

Public Sub savetoDB()

Dim mysqldb As ADODB.Connection = New ADODB.Connection
mysqldb.Open(".......connection string....")
mysqldb.Execute("INSERT INTO table123 (content) VALUES
("LOAD_FILE('C:/test.rtf'))")
mysqldb.Close()

End Sub

The problem is that I don't know any way to extract the rtf from the
BLOB field and place it back into the file. I've tried looking into the
mysql forums but I'm not getting much help. Any help you can provide
would be appreciated.

Thanks,
Waqas

Jan 16 '07 #2
Many thanks Cor! That worked great!
Cor Ligthert [MVP] wrote:
Wagaz,

In fact can you using this code do everything with any file that you want to
use as blob.

http://www.vb-tips.com/dbpages.aspx?...6-38b5a2f7fdf0

Have a look at the bottom, (as long as the pages are in reconstruction, this
for latter viewers of these pages)

Cor

<Wa**********@gmail.comschreef in bericht
news:11**********************@38g2000cwa.googlegro ups.com...
Hi Guys,

I'm doing some work with richtextboxes and want to be able to save and
load the content from them to a mysql database (including all
formatting). I figured the best way to do this would be to save the
contant of the rtb to an rtf file and then load the file into a mysql
BLOB field:

Public Sub savetoDB()

Dim mysqldb As ADODB.Connection = New ADODB.Connection
mysqldb.Open(".......connection string....")
mysqldb.Execute("INSERT INTO table123 (content) VALUES
("LOAD_FILE('C:/test.rtf'))")
mysqldb.Close()

End Sub

The problem is that I don't know any way to extract the rtf from the
BLOB field and place it back into the file. I've tried looking into the
mysql forums but I'm not getting much help. Any help you can provide
would be appreciated.

Thanks,
Waqas
Jan 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Garyrek | last post by:
Hi I have an url where I have xml data POSTED and I need to parse the URL to read the data - Meanwhile here is my xml data =================================== <?xml version="1.0"...
1
by: Cindy Lee | last post by:
I need to insert rows into MySql database from oracle, which I imagine is a rather common task. The path I decided to take is write a java procedure, as recommended in the manual. However, java...
0
by: cmars | last post by:
Hi, I want to insert massive amounts of data in near real-time into a MySQL database. The data is in a structured binary format, and I have code that parses the data into logical data structures. ...
4
by: Shaun Campbell | last post by:
I know you're going to say search the mail archives, but I have and I can't find an answer to my simple question of is there an SQL statement to load an image in a .jpg file into a database table?...
5
by: adrin | last post by:
hi, i am writing a program that is supposed to create a database of my music and albums. i want it to consist of 3 'modules' input<->processing<->output. input should enable reading data from cd...
10
by: Krakatioison | last post by:
Hi everyone, can someone point me to download of an example for saving and retrieving to/from MYSQL database. Or did anyone of you tried this and could share your code with me. I've got some data...
6
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data)...
10
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without...
7
by: Dave Kelly | last post by:
There has to be a name for what I want to do and I don't know what words to google for. I have a form here: http://www.texasflyfishers.org/firstpage.htm I want to submit it to the server and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.