Tags: access, anole, application, cool, database, double-click, embedded, exe, extract, ive, microsoft, mysql, ole-embedded, oracle, package, run, runs, sql, utility, vba, via

Run/Extract OLE-Embedded application via VBA?

On Database » Microsoft Access

2,687 words with 1 Comments; publish: Wed, 04 Jun 2008 02:43:00 GMT; (25093.75, « »)

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?

All Comments

Leave a comment...

  • 1 Comments
    • 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.

      "Snaux" <snaux.ms-access.todaysummary.com.cox.net> wrote in message

      news:1168378630.386718.96290.ms-access.todaysummary.com.p59g2000hsd.googlegro ups.com...

      >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?

      >

      #1; Wed, 04 Jun 2008 02:44:00 GMT