Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to load a picture from database

Status
Not open for further replies.

KhushiRaina

Programmer
Oct 9, 2002
32
IN
Hi all,
Hey how can i load picture field from database.I know it can be done from local disk but i wanted from database to show it on image or picture control.
Any Suggestions.....

Khushi
 
Hi Khushi,

What kind of database are you using?
SQL Server 7.0 / 2000
MSAccess
Flat File
FoxPro
...
 

If the image is stored in the db, as oppesed to a link to an image, or a file name being stored, then use the GetChunk method under ADO to get the long binary data and put it into a temp file. The rest you say you know already.
Thread709-391834

Under DAO use the OLE container control.
 
It is also possible to avoid use of GetChunk and the necessity of using a temporary file by using an ADO stream, and the fact that OLE pictures are persistable...
 

I think I touched upon using an ADO Stream in that thread, or somewhere else, but that was basically saving the picture back to the DB from a file.
 
You do indeed mention streams there (and also make the important point that large BLOBS impact SQL Server performance).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top