Storing Images into MS Access 2000

Question:

Can I store an Image file into my MS Access Database.
How is it done?. Please include some brief explanation
so that I can understand. Your help is kindly appreciated.

Regards
Eugene
eugene007Asked:
Who is Participating?
 
simonbennettCommented:
Hi

My 2 pence

Unless you have a compelling reason *don't* store images in your database! You will fund the size ballon very quickly, and displaying the picture requires an OLE object control on the form which is inefficient. Also the images are stored with a binary ole wrapper which means even more space required.

A tried and tested alternative is to simply store the path and filename of the image in a text field in your database. To display it, simply use the LoadPicture method to put the image into an image control (most efficient) or a picture box control (less efficient)

HTH and good luck

Simon
0
 
lyonstCommented:
Hi,

Extract from ...

http://msdn.microsoft.com/library/officedev/off2000/achowCreateFieldStoreOLEObjectsS.htm

First Step,

Open a table in Design view.

To insert the field within the table, click in the row below where you want to add the field, and then click Insert Rows  on the toolbar.
To add the field to the end of the table, click in the first blank row.

In the Field Name column, type the name for the field, following Microsoft Access object-naming rules.

In the Data Type column, click the arrow and select OLE Object.

 Note :  OLE Object fields are used to store data such as Microsoft Word or Microsoft Excel documents, pictures, sound, and other types of binary data created in other programs. OLE objects can be linked to or embedded in a field in a Microsoft Access table. You must use a control in a form or report to display the OLE object. To find out more about editing and displaying objects stored in OLE Object fields, go to

http://msdn.microsoft.com/library/officedev/off2000/acdecAddBoundObjectFormReportS.htm

Cheers,

T.
0
 
lyonstCommented:
Hi Eugene,

General Guidelines for Questions.

If your question is easy to answer, offer 50 question points. If it is more difficult, increase the points to 100, and if it is very difficult, offer 200 question points.

You tend to get better answers that way.

Cheers,

T.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
eugene007Author Commented:
^-^
okies. But I am scared that I wont have enough points to
ask more questions..:)

Regards

Eugene
0
 
lyonstCommented:
Hi,

I could always lend you some ....

Just kidding .... no problems.

Did any of the comments help you or do you need any more information.

Cheers,

T.
0
 
Homer1779Commented:
I agree with Simon, its really not a good idea to store images in Access... your database will grow to a silly size.

Store files externally and load them into OLE control

cheers

George
0
 
lyonstCommented:
Unless you want to keep them secure for instance...yes I know there are other ways....

T.
0
 
eugene007Author Commented:
well actually I intend to understand the concept used in the match making sites where the paging concept is used.
So you can browse the users information together with
their picture in the database. I am open to receive any new Ideas, codes and etc. I really want to understand
and not just copy and paste..:). Your help is kindly
appreciated.

Regards
Eugene
0
 
eugene007Author Commented:
well, I am using .ASP to do so.
0
 
simonbennettCommented:
Aha!

If you are using ASP it is much simpler to store paths in the DB - I do this all the time. Okay so you will need to know where the images are, let's say in you <root>/images dir. Your asp code to produce the image will look something like

response.write "<img src='images/" & rstRecordset("ImageFile") & "'><BR>"
response.write "<B>" & rstRecordset("PersonDescription) & "</B>"

HTH

Simon
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.