Run/Extract OLE-Embedded application via VBA?

S

Snaux

I have a small utility (.exe) that I've embedded in my database as an
OLE Package. I found that if I double-click it, it actually runs...
very cool and quite unexpected functionality for a low-end db like
Access. My database "shells" numerous small utilities like this, which
got me thinking about using my database as a container for them, to
both aid in distribution and to keep idle hands from playing with them.


1) How can I get the OLE Packaged executable to actually run via VBA,
as opposed to double-clicking the field that contains it?

2) Once embedded in the db as an OLE package, is there a way to extract
it back to a standalone .exe file?
 
S

Stephen Lebans

It might be simpler for you to just store a copy of the Exe in a Long Binary
field. At runtime, copy the contents of the field to a temp file and then
Shell to this file. I'm sure there will be security issues that must be
considered.

If you prefer to stay with OLE, your Exe is inserted as an object of type
Package. Your Exe file is wrapped in a small header, the details of which
are explained in the tool I will point you to on my site. You can easily
extract the embedded Exe file.
http://www.lebans.com/oletodisk.htm

I have not tested on Packaged Exe files, but you should be able to createa
hidden form with an OLE Frame control bound to the field in question, and
call the control's Activate method to launch the embedded Exe.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top