Login | Register
Find Code
 

Close

 
  • Submit Code
  • ASP, HTML and XML
  • Database
  • Dates and Math
  • Files and Directories
  • Forms and Controls
  • Lists, Collections and Arrays
  • Miscellaneous
  • Multimedia / Games
  • Network / Internet
  • Office/VBA
  • Registry
  • Screen / Graphics
  • String Manipulation
  • System API
  • VB.NET / ASP.NET
  • Windows 2000/XP
 

Save/Retrieve Image From SQL Server Database Using Ado 2.5 Stream Object

Category:
Database
Type:
Snippets
Difficulty:
Intermediate
Author:
Michael P. Gerety

Version Compatibility: Visual Basic 6

More information:
*** NOTE *** You MUST Use ActiveX Data Objects 2.5 or HIGHER

I had been trying to use the AppendChunk()/GetChunk() functions with SQL Server 7.0 to no avail as when I did a select statement on my table which housed a column of type "Image", the dataType and Format were "unsupported" by VB.

Using the ADO Stream object it is much easier to get/retrieve image data from a SQL Server Database. Below is a very simplified version of my code.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code:
Sponsored Links: