Solved

Storing Images into MS Access 2000

Posted on 2001-06-19
10
204 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

738 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