Hi
just wondered if there is code to create an mde, just for ease really (lazyiness)
Cheers
11 3152
My guess would be no! And if you could it would be a really bad idea! Too many things can go awry during the creation that require the attention/intervention of the developer.
Linq ;0)> @Dan2kx
Aside from changing the Source and Destinations, use the code exctly as posted: - Private Sub cmdCreateMDE_Click()
-
On Error GoTo Err_cmdCreateMDE
-
Dim AppAccess As Access.Application
-
Set AppAccess = New Access.Application
-
Dim strSourceDB As String
-
Dim strDestinationMDE As String
-
-
'****************** Customize here ******************
-
strSourceDB = "C:\CreateMDE\Test.mdb" '*
-
strDestinationMDE = "C:\CreateMDE\TestMDE.mde" '*
-
'****************************************************
-
-
'Code should go here to see if strDestinationMDE already exists!
-
-
DoCmd.Hourglass True 'Critical!!!
-
-
AppAccess.SysCmd 603, strSourceDB, strDestinationMDE
-
-
DoCmd.Hourglass False
-
-
MsgBox strSourceDB & " has successfully been converted to " & _
-
strDestinationMDE, vbExclamation, "MDE Conversion"
-
-
Exit_cmdCreateMDE:
-
Exit Sub
-
-
Err_cmdCreateMDE:
-
DoCmd.Hourglass False
-
MsgBox Err.Description & vbCrLf & vbCrLf & _
-
strSourceDB & " has not been successfully converted to " & _
-
strDestinationMDE, vbCritical, "MDE Conversion Failure"
-
Resume Exit_cmdCreateMDE
-
End Sub
Does that work with the active DB?
@Dan2kx
To be honest with you, I didn't test the code with an Active Database. If you do, I strongly suggest using a Copy and testing with that.
In my experience this does not work on the active DB, because creating an MDE requires the DB to compile first which cannot happen while you are running code in VBA. But I must ask, why would you want code to make an MDE in the active DB when you can simply run the Make MDE File... from the tools?
-AJ
I modified the code block so that it should create a *.MDE File based on the Active/Current Database with the exact Base Name as the *.MDB and in the same Directory. Although the code indicates success, the actual *.MDE is never created. The reason for this is more than likely that indicated by ajalwaysus in Post #6. I too would like the know the reason why you would even attempt this. - Private Sub cmdCreateMDE_Click()
-
On Error GoTo Err_cmdCreateMDE
-
Dim AppAccess As Access.Application
-
Set AppAccess = New Access.Application
-
Dim strSourceDB As String
-
Dim strDestinationMDE As String
-
-
'*************************** Customize here ***************************
-
strSourceDB = CurrentProject.Path & "\" & CurrentProject.Name
-
strDestinationMDE = Left$(strSourceDB, Len(strSourceDB) - 4) & ".mde"
-
'**********************************************************************
-
-
'Code should go here to see if strDestinationMDE already exists!
-
-
DoCmd.Hourglass True 'Critical!!!
-
-
AppAccess.SysCmd 603, strSourceDB, strDestinationMDE
-
-
DoCmd.Hourglass False
-
-
MsgBox strSourceDB & " has successfully been converted to " & _
-
strDestinationMDE, vbExclamation, "MDE Conversion"
-
-
Exit_cmdCreateMDE:
-
Exit Sub
-
-
Err_cmdCreateMDE:
-
DoCmd.Hourglass False
-
MsgBox Err.Description & vbCrLf & vbCrLf & _
-
strSourceDB & " has not been successfully converted to " & _
-
strDestinationMDE, vbCritical, "MDE Conversion Failure"
-
Resume Exit_cmdCreateMDE
-
End Sub
That would require two or three mouse clicks, and as he said, he's lazy!
Linq ;0)> @missinglinq
Yep just wondered if it was theoretically possible, i am a little lazy as mensioned; i have a version number hardcoded into VB (and therefore the MDE) and a version number stored in a linked table so that old versions "know" that they are old and then download the most current version from a server location, in my update code i was considering using the MDE automation... upon your advice i think i should reconsider yes?
Thanks anyways,
Dan
I have developed a version controlled databases, like it sounds like you are. When dealing with revision control, you usually need a singular hub (Switchboard) to handle all the version control, so that if what you need is out of date the Switchboard would then get you the most up to date.
Since I have a lot of experience with this, I could provided you with some best practices. But so i don't do the work for you, you can bounce some ideas off me if you wish.
-AJ
I think i have the version control pretty sussed, i only ever have "the newest" release which over writes the previous MDE, so if the active version is out of date (upon DB open) it creates a CMD file, closes, runs the CMD file to pull the new version and wallah!
Pretty simple but it works well, put some of my collegues to shame (who have no version control, or simply a message to alert you to seek the new version)
i can post the code if you are curious?
Thanks again
Dan
I'm good, thanks. But this is a different way than I do it, sounds interesting. Have Fun!
-AJ
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jon Gross |
last post by:
We have a project that will require the almost realtime (every 5
minutes) creation of user accounts and a FTP site for each of them. I
would like to write a VB.Net application to do this. This...
|
by: Chris via AccessMonster.com |
last post by:
I have the challenge of needing to automate table creation. It doesn't end there the tables have to be created from one table that looks something like this...
Email ...
|
by: cyranoVR |
last post by:
This is the approach I used to automate printing of Microsoft Access
reports to PDF format i.e. unattended and without annoying "Save As..."
dialogs, and - more importantly - without having to use...
|
by: Jeremy |
last post by:
Is anyone aware of any features in .NET or 3rd party tools that would enable
the automated creation/modification of graphics (e.g., buttons with text in
them). I frequently need to modify only the...
|
by: Nick Dreyer |
last post by:
I was quite surprised to notice that Sub New() gets called twice,
once at declaration time and once at creation time. I can't figure out
why it would be called at declaration if there is no class...
|
by: Karl |
last post by:
Hi all,
I regularly use FTP to place Self Extracting Zip files on the web for
remote users to update their datafiles. Works very nicely.
I have automated the creation of the initial zip file (...
|
by: amg |
last post by:
I'm looking for a way to automate the creation of an ODBC System DSN for an Oracle driver (Oracle client 10g).
Any help (scripts, pointers, sample code) will be greatly appreciated.
Thanks,
|
by: gert365 |
last post by:
I'm working on a scirpt to be used on a windows machine and I need to
automate a user's input on the command prompt. For example I'm using
os.system('mycommand') to excute the commands I want. ...
|
by: Ots |
last post by:
I'm using SQL 2000, which is integrated with a VB.NET 2003 app.
I have an Audit trigger that logs changes to tables. I want to apply
this trigger to many different tables. It's the same trigger,...
|
by: =?Utf-8?B?QWxleGFuZGVyIFd5a2Vs?= |
last post by:
Is it possible to automate a COM object ebmeded in an excel document run the
process and return the results in a C# .NET application? Or better yet
extract the com object some how and just run it...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |