January 3rd, 2004, 09:30 AM
Binary data in SQL Server 2000
hi ppl, i just want to ask about data handling in C/C++ programming.
Say it like this. i have a table in SQL Server 2000 and one of the data field in that table with image data type, and when i the table content, it just appear "<binary>" in data field value. But in this field value have encoded text.
So my problem is:
1) i wanna retrieve the binary data in that table and return it to my program and hold it with some type of variable. i wanna know about the var type which support that kind of data type such as DWORD or WORD i think...
2) some fellow said that the data can be decode to normal again by using some sort of internal function like System.??.ascii.??
3) and i wanna know how to passing the value from one binary data type to another (the syntax example..)
i'm stuck on that problem i mention above..
tx for ur intention..
(Wholly owned by Cyberdelia Group).
January 3rd, 2004, 01:18 PM
hi, i dont know how helpful this might be but i had similar problem with <binary> data type using sql 2000 but what i ended up doing was to use a var datatype instead of binary; then use the path to the image file as the record. example:
if i wanted an image called "car" in "c:\ pictures" to be displayed, I made the datatype of the (eg. vImage) as var (in the database) and entered "c:\pictures\car.gif" as the record. Then on the form that I was designing I just made the source of the field as vImage from the database.
[gloworange]Not all that glitters is gold [/gloworange]
January 3rd, 2004, 04:36 PM
1) Storing and manipulating binary blob data in sql server is a bad idea. Sql server does not tend to play nice with it, and can give you alot of problems if you don't know what you are doing.
2) In order to do anything with the data held in the binary blobs you will need to know beforehand what it is and how the data is actually structured. Then you can read what you need and reconstruct it into it's normal form. It's alot like reading and writing binary data to regular files.
"When I get a little money I buy books; and if any is left I buy food and clothes." - Erasmus
"There is no programming language, no matter how structured, that will prevent programmers from writing bad programs." - L. Flon
"Mischief my ass, you are an unethical moron." - chsh
Blog of X