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
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
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.
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.
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.
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
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.
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.