Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-10-07
5
Medium Priority
?
671 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

618 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