Solved

Storing Images into MS Access 2000

Posted on 2001-06-19
10
201 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:eugene007
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 15

Expert Comment

by:lyonst
ID: 6209408
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
 
LVL 15

Expert Comment

by:lyonst
ID: 6209418
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
 

Author Comment

by:eugene007
ID: 6209512
^-^
okies. But I am scared that I wont have enough points to
ask more questions..:)

Regards

Eugene
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 6

Accepted Solution

by:
simonbennett earned 30 total points
ID: 6209541
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
 
LVL 15

Expert Comment

by:lyonst
ID: 6209545
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
 
LVL 1

Expert Comment

by:Homer1779
ID: 6209998
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
 
LVL 15

Expert Comment

by:lyonst
ID: 6210020
Unless you want to keep them secure for instance...yes I know there are other ways....

T.
0
 

Author Comment

by:eugene007
ID: 6211119
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
 

Author Comment

by:eugene007
ID: 6211185
well, I am using .ASP to do so.
0
 
LVL 6

Expert Comment

by:simonbennett
ID: 6211540
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

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question