Solved

Using SQL to insert image into MS Access

Posted on 2009-05-05
5
309 Views
Last Modified: 2012-05-06
How do I write the SQL to insert an image into an OLE object in Access?

This is on a web server.

Let's assume the image is in "tempwork/abc.jpg".

Is it like this:
x = "tempwork/abc.jpg".
INSERT into table (oleimage) values('" &  x & "')"

0
Comment
Question by:Richard Korts
[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
5 Comments
 
LVL 25

Accepted Solution

by:
reb73 earned 500 total points
ID: 24308468
It may be inadvisable to store images in an MS-Access database as you may have problems with bloating in terms of mdb filesize over time..

But if you want to go ahead and do so, it may not be possible to do it with pure SQL code.. Have a look at the link below which has code example using getchunk/appendchunk -

http://acmesoffware.com/acme/ExamplesVBA/vbaExm_appendchunkimages.asp
0
 
LVL 11

Expert Comment

by:Goodangel Matope
ID: 24310998
It is not possible to use just SQL to insert the image. You will need to use VBA, or other programming language like Visual Studio / Delphi to do this.
0
 

Author Comment

by:Richard Korts
ID: 24311010
To all:

I am using VBscript on a web server. Can it be done using that?

Thanks
0
 
LVL 25

Expert Comment

by:reb73
ID: 24312066
The link provided in my previous post (http:a24308468) has VBA code which you should be able to adapt to VBScript...
0
 

Expert Comment

by:mmiski
ID: 24314897
I've inserted images using access,  If I remember right I had to copy then paste the image for each record to be able to save the image, but size of the database will grow quite fast and after a few hundred images you will see performance issues.  The best practice would be to simply save the image in a predefined folder then use a text field and save the path to the image and then using VBA or VB script to display the image where the path is located.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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…

736 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