?
Solved

Can I declear a variable in VBA as an OLE object.

Posted on 2008-10-07
5
Medium Priority
?
642 Views
Last Modified: 2013-11-27
Hi:
Can I declear a variable in vba as an ole object.
Because I have I picture in a table, and I need to move this picture from the table to this variable
0
Comment
Question by:Mohammad Alsolaiman
[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 66

Assisted Solution

by:Jim Horn
Jim Horn earned 400 total points
ID: 22662348
afaik no, and even if you could, I would highly question whether you should.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22692098
M_SOLAIMAN,

As you know, it is always helpful if you explain *why* you need to do this.

There might be a better way.

JeffCoachman
0
 
LVL 26

Accepted Solution

by:
dannywareham earned 1000 total points
ID: 22698226
A variable can only hold certain types of data (strings, numbers etc).
An OLE object is both an embedded/linked object AND the application wrapper associated with it.

For example, your image (.bmp) is actually an image file wrapped in the MS Paint application.

Access doesn't store images well and having them in your system will cause bloating.

You can either look into using Binary Long Objects (BLOBS) or, my prefered method, store the image in a shared network area and store the text hyperlink address for that image in your table.
Then you can use a simple piece of code to pull the image into a frame/image object on your form.
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 600 total points
ID: 22698797
M_SOLAIMAN,

Now you see why most Access Developer do not store images in the Access database.
:-)

Go here:
http://www.lebans.com/oletodisk.htm

Downoald the file named:
ExtractInventoryOLE.zip

Extract the files to a folder.

Open the DB
Open the form called: ExtractInventoryAllOLEobjectsFromTable

This will convert each Object in the OLE field to it's respective file type.

JeffCoachman
   
0
 

Author Closing Comment

by:Mohammad Alsolaiman
ID: 31503839
thanks to all
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 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