Saving bitmaps into a database 
Author Message
 Saving bitmaps into a database

Can anyone help with a small problem.

I am attempting to create a project to allow the saving of
images/bitmaps into a
sql server database.
I can perform this operation with a data bound control but I need to be
able to do this with pure VB4 Code.
At this time I have full control on how both the client and the database
should be configured.
I have searched all of the documents available to me including MSDN and
VB/SQLServer books online but to no avail.

I had expected this problem to be fairly easy but so far have been
unsuccessful.
I already have test code that will read a image from a database.
also I can easily load the image into a VB Control and can save
all the other data that goes with the image but can see no way to
convert the image from a handle into a binary datastream.
Can anyone help with either a sample project or some pointers.

Thanks
Martyn.



Sat, 05 Jun 1999 03:00:00 GMT  
 Saving bitmaps into a database

You need to use a temp file as an intermediate step.  That is, when
saving to the database, you save the picture as a temp file and then use
the AppendChunk method to write the temp file data to the database.
When reading from the database, use the GetChunk method to write your
data to a temp file.  Then use the LoadPicture or ReadFromFile method to
load the file.

There are examples in the MS KB - search on AppendChunk.

- John Kenyon

Quote:

> Can anyone help with a small problem.

> I am attempting to create a project to allow the saving of
> images/bitmaps into a
> sql server database.
> I can perform this operation with a data bound control but I need to be
> able to do this with pure VB4 Code.
> At this time I have full control on how both the client and the database
> should be configured.
> I have searched all of the documents available to me including MSDN and
> VB/SQLServer books online but to no avail.

> I had expected this problem to be fairly easy but so far have been
> unsuccessful.
> I already have test code that will read a image from a database.
> also I can easily load the image into a VB Control and can save
> all the other data that goes with the image but can see no way to
> convert the image from a handle into a binary datastream.
> Can anyone help with either a sample project or some pointers.

> Thanks
> Martyn.



Sat, 05 Jun 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Saving Bitmaps to a Database

2. Saving Bitmaps to a Database

3. As I make to save bitmaps in a database?

4. As I make to save bitmaps in a database??

5. Saving Bitmaps

6. Help! Saving Bitmaps

7. Saving Bitmaps to different color modes

8. Q: How to save pictures as compressed bitmaps?

9. Saving A4 bitmaps in B/W

10. saving bitmaps, icons, metafiles in 1 file

11. Saving bitmaps.

12. Saving Bitmaps

 

 
Powered by phpBB® Forum Software