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

How to save images in SQL Server 7 database 3

Status
Not open for further replies.

nimsam

Programmer
Sep 4, 2002
11
LK

I need to save a images (pictures) in SQL Server 7 database in my VB application

I used backend as Sql server database and frontend is a VB

In this case i have defined one data filed as a image type in sql server database

I would like to save & retrive the photos from my vb application.

can any body help me to how to save and retrive the photos from sql database

Please write some vb code for doing it

Thanks in advance



 
hi,
Best way to do this is save path for files rather then storing them in database. Saving them in database would make database grow. Also, I would be more diffucult to retrieve image file.

simply store path address to a perticular image and in your vb application get field contents that contain path info. use loadpicture method to load that picture in picture box or image box.

like : picture1.picture loadpicture(path + filenme)

However, you can retrieve images stored in a database using ADO. check
for Appendchunk and getchunk methods.


For details Post this thread at Visual Basic 6 Forum.




Bye
miq
 
Please don't ask us write your code for you. That is not the purpose of this forum. We will try to answer specific coding questions but you need to write the code.

Here are some links that you may find helpful. You may want to post additional questions in the VB 5/6 forum.

How to upload images or binary files into SQL Server tables?

HOWTO: Access and Modify SQL Server BLOB Data by Using the ADO Stream Object

HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk

Retrieve binary data from SQL Server via ADO's Stream object

Return of the BLOB

Copy text or image into or out of SQL Server

DBImage.dll

You may also find some of the postings in the SQL Server forum to be enlightening. Do a keyword search of this forum. Here are some of those threads.

thread183-247490, thread183-32427,
Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top