[kccrosser] I have to disagree with mrdenny – using SQL database table fields to store image blobs works quite well, and there are a lot of positive reasons to use this technique – not the least of which is the consistency of the database transactions and backups.
As far as how to manipulate the data from VB, assuming you are using ADO 2.5 or later, here is the Microsoft article which describes the appropriate code methods:
<a href=”http://support.microsoft.com/default.aspx?scid=kb;en-us;Q258038″>Microsoft article on VB and SQL blob data</a>
[mrdenny] This is not recommended as it will slow the database down, and case database bloat. It is much better to store the image on the file system somewhere and store a pointer to the file in the database.
If you must store them in the database, then create a table with a column using the datatype IMAGE. The IMAGE data type allows you to store up to 2 Gigs of data in the field (per row).
Create a stored procedure with an input parameter using the IMAGE data type.
In the VB code read the image file into a binary variable and pass it to the stored procedure.
When you see the image, select it from the database and put it into a variable, then render it from the variable, or save it as needed.