5 pts.
 Store picture from vb to access field
Hi, can somebody please guide me on how to link/save a picture in VB to store in an OLE field in access database?? Please let me know. In desperate need. Thanks in advance Princess8

Software/Hardware used:
ASKED: March 23, 2005  8:42 AM
UPDATED: March 31, 2005  10:45 AM

Answer Wiki:
I don't know if this will help, but I'd just make sure the picture is in a persistent location url/path whatever and store that url/path in the db. Or is the VB pgm creating the picture? Still, then it could be saved to the filesystem and referenced in db.
Last Wiki Answer Submitted:  March 23, 2005  4:37 pm  by  Grantwparks   0 pts.
All Answer Wiki Contributors:  Grantwparks   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

That would work for the forms but for reporting purpose i would require to store the pic so the the report could pick the picture directly. Awaiting desperate help. Thanks in advance.

princess8

 5 pts.

 

Storing it as a BLOB is typical (binary)… the reason most people don’t do this is that it inflates the database size a lot.

 0 pts.

 

If you need to display the images in the report, and if it is a web-based report, you can very well make use of IFRAME and provide its SRC attribute, the image path that you have stored in OLEDB field. The reason why I am suggesting this option is, because if an option of stored images on predifined location and storing the path in DB is available, it will be overhead to store full image.

 0 pts.

 

What I have done is created a text field in a table. Store the location of the picture (c:picturespicture1.jpg) for each record. Create the report but you must have at least one grouping. I stick everything in the grouping. Insert a picture object. It can be any picture; doesn’t matter.

Then on the OnFormat event of the grouping type me.image.picture (name of image object) = me.txtpicture (textfield)
format_count = 1

This takes a very very very long time and if you have lots of pictures, records, etc. even longer. Be patient.

 0 pts.

 

I am not sure exactly about access but I know for sure that sql server uses image type field to save pictures and oracle use BLOB datatype to save images.

You usually save things like Jpegs and Gifs into a database like access, sql or oracle save pictures in binary. There are a lot of material available over the web for this. Just type in saving binary data to database in VB. You will get a lot of hits in google or yahoo.
good luck.
Malik

 0 pts.

 

u can store ur images/files in access database using BLOB datatype, but this would inflate the database size. so its always preferred to store the path/url of the image/file into the database.

 0 pts.

 

You will be much better off in the long run if you save the picture to a file and store the path to the file in Access.

 0 pts.