Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically create an .mde file?

Status
Not open for further replies.

snoopy75

Technical User
Aug 24, 2001
340
US
Here's a toughie:

Is there any way to create an .mde file programatically, such as with a button on a form?
 
The MS Knowledgebase contains a code example that should create a MDE file programmatically.
I tried to make it work a couple of times but I never succeeded (8 years experience in ACCESS 2.0, 95,97, 2000 might not be sufficient?).
I finally found a workaround for every situation in which I thought that I would need this functionality.

Why do you need to create a MDE by code?
 
I'm just preparing for the eventuality that somebody else will need to take over and maintain my database. Every time I change the database, I release an "update" to my users in the form of a compiled .mde file.

I suppose anyone who maintains databases should be smart enough to figure out how to make a .mde file, but I thought it would be nice to have it all wrapped up in a little button named "Release Update" or something like that.

So it's not really that important, I was just curious. :)
 
More than a year later, this functionality is still desired, though; so if anyone ever comes up with a solution, please :) do post it here, pretty-please [ponytails2] .

My reason for wanting the functionality is to be able to create MDEs automatically for *a list of databases, all at once*. I want to make *my* job easier by implementing a batch update :) .

* * * *

I perform periodic updates to a whole batch of databases. Specifically, there is one module which goes into every database in general use at this company; that module contains a series of global constants that occasionally changes.

I already have a routine that exports the module into every relevant database automatically, and without intervention on my part. If I can create a routine to automatically create MDEs from the updated MDBs, then I'll have a complete batch update routine! I edit the module, doing what is needed to the constants, then save it and run a VB Sub that exports the module to all my other databases automatically. As things stand, I still have to compile each one separately and manually; but I'd love to eliminate that need [sadeyes] .

Microsoft's solution uses the SendKeys statement, which is too often unreliable because of the unpredictability of results. I avoid SendKeys if at all possible.

Right now, I use the RunCommand acCmdMakeMDEFile, and respond to the dialogs manually; at least my routine handles looping through all the relevant databases for me. In fact, since I have the database name in a variable, I change the extension and then get the name copied to the clipboard -- so that when the dialog comes up, all I have to do is use SHIFT-INS to paste the database name into the correct spot on the dialog, then hit RETURN. But, of course, I want more and better ;-) .

I'd love to hear if anyonce comes up with a solution (for Access 97, especially!).
-- C Vigil =)
(Before becoming a member, I also signed on several posts as
"JustPassingThru" and "QuickieBoy" -- as in "Giving Quick Answers")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top