473,387 Members | 1,561 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,387 software developers and data experts.

Storing and Retreiving SQL2K BLOBS

I have a need to store PDF, TIF and other files in TEXT fields on my
SQL2000 Server and them retreive them and restore them to the disk
(VB6). I created a table

CIP_DOCUMENT_ID int no 4 10 0 no (n/a)
(n/a) NULL
NAME varchar no 255 no no no
SQL_Latin1_General_CP1_CI_AS
BODY text no 16 no (n/a) (n/a)
SQL_Latin1_General_CP1_CI_AS

And wrote code to read the binary contents of a file into a varient. I
then stored the contents of the varient into the TEXT field (BODY). When
I reverse the process, the data is incorrect. Can someone show me a code
stub for doing this or point me in the right direction?

Dab

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
5 1090
David,
You should make your "BODY" field a data type of "Image".

I also found this Q article on Microsoft's web-site in case you need
some additional reference material:

http://support.microsoft.com/default...b;en-us;316887
Hope this helps,
David R. Jenkins

Nov 21 '05 #2
David,

In addidition to David, for storing and writting a Blob file to a SQL server
I have a lot of samples.

However all VBNet. (What is as well for the sample of David showed on MSDN)

For VB6 there are other newsgroups. All starting with
microsoft.public.vb

I think that beside of the Image answer from David you can get there easier
an answer on your question how to access that.

Just a little addition.

Cor

"David Beck" <da****@beckb.com> >I have a need to store PDF, TIF and other
files in TEXT fields on my
SQL2000 Server and them retreive them and restore them to the disk
(VB6). I created a table

CIP_DOCUMENT_ID int no 4 10 0 no (n/a)
(n/a) NULL
NAME varchar no 255 no no no
SQL_Latin1_General_CP1_CI_AS
BODY text no 16 no (n/a) (n/a)
SQL_Latin1_General_CP1_CI_AS

And wrote code to read the binary contents of a file into a varient. I
then stored the contents of the varient into the TEXT field (BODY). When
I reverse the process, the data is incorrect. Can someone show me a code
stub for doing this or point me in the right direction?

Dab

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #3
Cor,
Could you post your samples? I'd be interested in seeing them!
Regards,
David R. Jenkins

Nov 21 '05 #4
David,

This is my standard format for that for a windowform, when you need someting
like this for a webform or a webservice tell that than. (In the webservice
sample I have also the sample how to overcome the ole format and using a
thumbnail)

http://groups.google.com/groups?selm...TNGP11.phx.gbl

In this sample I have tried as much as possible to avoid the memorystream
(although it is in this sample as well)

I hope this helps?

Cor

"David R. Jenkins" <je******@gmail.com>
Cor,
Could you post your samples? I'd be interested in seeing them!
Regards,
David R. Jenkins

Nov 21 '05 #5
Thanks for posting the link! I am always interested in looking at the
way others write code. I find that it helps me improve my ways of
coding by seeing others work.

Thanks again!

Nov 21 '05 #6

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

Similar topics

6
by: Juergen Gerner | last post by:
Hello Python fans, I'm trying and searching for many days for an acceptable solution... without success. I want to store files in a database using BLOB fields. The database table has an ID field...
12
by: Ryan Stewart | last post by:
I am in extremely urgent need (by tomorrow) of a way to store files in and retrieve files from an Oracle database using TopLink as an intermediary. I have the JSPs for it, and it works for small...
2
by: David Horowitz | last post by:
Hi folks, I want to be able to store and retrieve UNSAVED Word documents as BLOBs. I got all the info for storing them if they're already saved on the file system. But what if they're not...
3
by: hamvil79 | last post by:
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around...
2
by: Joolz | last post by:
Hello everyone, Sorry if this is a FAQ, but I've groups.googled the subject and can't find a definite answer (if such a thing exists). I'm working on a db in postgresql on a debian stable...
1
by: tomi.trescak | last post by:
Hi I have a problem with storing rich text in MySQL. I store rich text in MySQL (in column with type "text") which i get from Rich Textbox control. When i do reverse processing by trying to...
4
by: lorirobn | last post by:
Hi, I need to add photos to my database. Back End is on MS SQL Server (I believe 2000), and Front End is on MS Access. I have read about storing the photos as BLOBS, but I am not sure how to...
4
by: pushpinderbagga | last post by:
hi I need help in storing and retreiving hindi text from myql... I have done the folowwing ... mysql_query("SET NAMES 'utf8'"); <META http-equiv=Content-Type content="text/html;...
3
by: Annonymous Coward | last post by:
I remember readng that BLOBs can be stored externally (with reference to the BLOB file stored in tables instead). Does anyone have any experience doing this ? I have a few questions: 1).what...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.