Solved

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

Posted on 2008-10-07
5
628 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 100 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 250 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 150 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

Technology Partners: 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!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

695 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