473,583 Members | 3,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Gene ral_CP1_CI_AS
BODY text no 16 no (n/a) (n/a)
SQL_Latin1_Gene ral_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 1106
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.publi c.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.c om> >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_Gene ral_CP1_CI_AS
BODY text no 16 no (n/a) (n/a)
SQL_Latin1_Gene ral_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
5677
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 (INT, auto_increment), an ORDER field (INT, for knowing the right order) and a "normal" BLOB field. It is planned to split large files in 64k-parts...
12
5310
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 files, but larger ones like Word documents and Excel Spreadsheets give an error saying that the data is too large for the field. Can anyone help with...
2
6435
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 already saved? I could save them to a temp file first and then make it a blob, but I'd rather not put them on the file system at all. I could use...
3
4710
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 2Mb) are stored in BLOB column. The amount of documents for the first year should not exceed 5/6 Giga, but I cannot make prevision for the next...
2
2056
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 server, ext3 filesystem. The db will contain files, not too many (I expect somewehere between 10 and 100 files max to be inserted daily), and not too big...
1
11730
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 fill rich text back to rich techbox (i set correct property "Rtf") i get whole text like: {...
4
3917
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 do this with SQL Server. Does this mean store the photo as OLE image, but do something else to it to make it a "Blob"? I have also read about...
4
5133
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; charset=UTF-8">
3
3309
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 are the things to watch out for (apart from obvious ones like 'file not found' type errors). 2). How may a stored proc be written to fetch the BLOB...
0
7896
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8195
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6581
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5375
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3820
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3845
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.