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!

How do I store images in SQL table?

Status
Not open for further replies.

MELc

Programmer
Aug 14, 2002
7
US
I've added an image column but I don't know how to store an image into the column. Please help.
 
The way I used to do it was saving the file path of images in a column, then retrieve the file path from the column when needed.

Anyone has a better idea?


Min.
 
Normally you will be doing it thru an application written in say VB or PowerBuilder etc.

I have done this in PB and can tell u how it can be done thru that.

PB provides for blob (binary large object) variables. You can open a file and read its contents into such a variable. PB also provides an interface to ODBC drivers to send this data thru a special update statement called UPDATEBLOB

UPDATEBLOB table
set image_column = :blob_variable

Only requirement is that the ODBC connection should be set with autocommit = true mode

I have seen image control in VB, where you can define the image file path and the image control can be mapped to a datasource/data column. I guess, one should be able to insert/update using such a control in a VB app. Probably you will need to explore on this..

RT


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top