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!

Can I "store" an image within Access? 2

Status
Not open for further replies.

kndavies

Technical User
Jan 23, 2003
30
GB
Hi

I have an application that generates reports in Excel. I would like to add cover sheets with a logo to these reports - is there a way I can save the logo within the application for this or will I have to reference an external file?

Thanks in advance

Ken
 
k: You can store it in a table and make reference to it (setting the field type to an OLE Object).
 
You can, but usually, you just want to store a link to the path of the image. If you store the image in the DB, Access has to store a lot of overhead along with it and this makes your DB grow alot... Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Yes, it is true that a database grows alot with tables that have pictures in it. But is there a way of getting around storing it in a table if you need to have a web site search for pictures? For example a catalog.
Because, the pictures that I use in my database simply reference the path to the file in the file system.
But can I still do that in a search for a website?

Thanks
 
rom: ASP.NET has several techniques for locating images on the server - not sure about other techniques. What framework are you using on the net? ASP? ASP.NET? DAPs?
 
I think most people have missed the point of the original question.

This 'image' file is a one-off . The question is not like storing photos of people in their personnel file - one picture per record; it is one logo image ( 5k of gif file probobly ) in the whole database.



My thoughts are:-
You should create a specialist table to hold the image in.
Make it have two fields, the first of Type Yes/No with a default value of YES.
Then make this field the primary key.
That way the table can never have more than one record.
For the second fieled, as Isadore mentioned, use an OLE type field and store the image file in there.

Then, when the organisation changes their corporate logo ( oh Yes they will ! - eventually ) you can then change the image quite easily.

If you put a link to an external file into your code then
A) The file could get lost, deleted, moved etc
B) The code will need updating if you want to change the logo file



'ope-that-'elps

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Hi,

Thanks to both Little Smudge and Isadore, you are correct in thinking it is a one off logo and I have created a table as you suggest.

I have now been playing for a while but have not managed to successfully get this logo onto the Excel file - assume everything else is working (ie data transfer to Excel OK, all manipulations OK) how do I get the logo from the table to the spreadsheet?

Many thanks again,

Ken
 
kn: do a thorough search here at tek tips for transferring data to Excel (a specified cell); there are several. Little's suggestions looks good.
 
One trick with access and images is to not try to help access. By that I mean, define a field with no 'type' or at most a field that is 'Variant'.

Then copy your image to that field and finally move the temporary field to the Excel target field. You may need to use the 'Set' command, it has been a while and I forget how I made it work.

I had a database that had 1000's of recipes and about ten large images. I place the 10 images in a seperate table in a linked access database called 'Graphics.mdb'

I like to keep the images in a DB if possible so my users do not mess up things accidently.

Access tends to get a little funny when you try to help by descibing graphic fields.
Access Add-on developer
 
How do I insert a picture into a form? I want the user to be able to insert a picture into a form and also be able to print out the picture when the report is printed. It will be a different picture for every form.
 
Newbie wanting to have a specific picture appear with each record on a form. I read with interest THoey's March 18 reply where the advise was to "store a link to the path of the image" (so as to keep the DB from growing as it would by storing OLE objects). Sounds great, but where do I put the link? In a table upon which the form is based? And what kind of field do I create to hold that link? And is the link actually a path to an image on my drive? Don't know Visual Basic, so hoping the answer will not require this knowledge.
 
kndavies, resanders,
Look into the ImageList object and the LoadPicture functions, that may be what you're looking for. The ImageList will store images in the app, and makes for quick and easy dissemination of those images.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top