Solved

Storing Images into MS Access 2000

Posted on 2001-06-19
10
199 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
Comment Utility
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
Comment Utility
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
Comment Utility
^-^
okies. But I am scared that I wont have enough points to
ask more questions..:)

Regards

Eugene
0
 
LVL 6

Accepted Solution

by:
simonbennett earned 30 total points
Comment Utility
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
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Expert Comment

by:Homer1779
Comment Utility
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
Comment Utility
Unless you want to keep them secure for instance...yes I know there are other ways....

T.
0
 

Author Comment

by:eugene007
Comment Utility
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
Comment Utility
well, I am using .ASP to do so.
0
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now