Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Storing Images into MS Access 2000

Posted on 2001-06-19
10
202 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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 …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

809 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