I'm a vb-programmer and new to mssql.
I've got a problem saving binary data from an image (.jpg or .bmp) to
an image-type field in a MsSql 7.0 database.
Here's what i do; First I open the .bmp or .jpg for binary read.
Determine the size of the image and set the size of the chunks to 1K,2K,
Then i'm getting the chunks from the file and saving the chunks by applying
the AppendChunk method.
So far so good. Now when i try to get the data from the image-field to store
in a temporary file for
loading into an image control, the data in the image-field appears to be
twice the size of the original
image. I did a number of tests. First i checked what the ActualSize of the
image-field was directly after
the saving the first chunk. The ActualSize is then indeed twice the size of
the chunk. (i'm not saving it twice)
So it seems sql is adding an extra byte for each byte saved.
I also tried to save the data into a binary and a varbinary field.
In this case the AppendChunk method raises an error; Error 3219 Method not
permitted in this context.
Does anyone have a solution for this problem ??
Another data-type maybe or a solution for the 'double size'.
Thanks in advance, Leon