2 Replies - 3203 Views - Last Post: 19 January 2012 - 06:16 AM Rate Topic: -----

#1 Razgriz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-December 11

Saving and Retrieving image in sql server 2005

Posted 19 January 2012 - 04:54 AM

Hi there!
Im currently working on an image oriented system. Im having problems on how to save and retrieve it. My question is, is it possible to save the image path on your sql table then retrieve it based on an ID# entered in a textbox. What data type should i use in the sql server? and is it just the same as saving a data in saving an image path so I could retrieve it later? I only know how to upload an image but i find very tricky saving and retrieving it. anyway here's my code in uploading image.
Thanks in advance! cheers!
Private Sub cmdUpload_Click()
Dim i As String

On Error GoTo ErrorHandler
With objCD 'objCD common dialog
.CancelError = True
.DialogTitle = "Open Image"
.Filter = "Images|*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.raw;*.rle|All Files|*.*"
.ShowOpen

Picture1.Picture = LoadPicture(.FileName)

End With

ErrorHandler:
End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Saving and Retrieving image in sql server 2005

#2 Razgriz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-December 11

Re: Saving and Retrieving image in sql server 2005

Posted 19 January 2012 - 05:29 AM

By the way I used VB 6 as my front end here ^^
Was This Post Helpful? 0
  • +
  • -

#3 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Saving and Retrieving image in sql server 2005

Posted 19 January 2012 - 06:16 AM

I wouldn't recommended storing images in the DB.

Store the path as you suggested. You could store them in a table with the path, an ID and description if you wanted to.

Then use the path returned from the database to load the image.

There are tutorials on here on how to work with databases.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1