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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing images

Status
Not open for further replies.

tuckstar

Programmer
Feb 17, 2003
2
ZA
I am struggling to store images in the database. I can open and read text and ntext datatypes. However I was wondering what function I should use to bring in an image? I have been trying WriteText but no luck yet.
 
The best advice is don't do it! It is much, much easier to store the images in a folder somewhere and just store the path in the DB.

I've never done it myself, but I think you need to get the binary stream of the image in your front-end app and insert this into the column.

As I say, if you can possibly avoid doing this, then do! --James
 
Most of us prefer to store the path and then reference the path to call up the image rather than use the text/ntext data types. It is easier to work with. It is easier to maintain the images this way too as they are in their native format and thus can be updated simply by copying the new version into the directory, rather than having to update the database.

But you are right, writetext is the command to use to put data into the database in that format. Exactly what is the problem and what code are you using?
 
Thank you very much for your help. I had thought about doing what you had said but thought it may be pretty simple to store pics in database. Will take your advice and store pictures outside of database.
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top