Solved

Ways to convert a .mdb to a .exe

Posted on 2004-04-19
25
195,504 Views
Last Modified: 2013-12-05
Hello all,

I have a database in Access .mdb and would like to convert it to a .exe

1 possible way would be to use Office Developer but it seems like Microsoft has discontinued the product? I can't find it anywhere and even if i do, i'm not gonna fork out that sum of money just for converting the database.

Does anyone else have any other ideas to convert the .mdb to an .exe?

Xhenkaii
0
Comment
Question by:xhenkaii
25 Comments
 
LVL 32

Accepted Solution

by:
jadedata earned 50 total points
ID: 10864807
This can not be done.  To have an .exe you must write your application in a compileable language.
The MS Office Developer did not supply the means to create a exe from an mdb, only to be able to build a deployable that would set up the app according to specs.
0
 

Author Comment

by:xhenkaii
ID: 10864906
Hi jade,

I understand what u mean. What i actually need to do is to create a deployable where only the GUI is accessible to the user.
I cannot create a MDE file. It seem to require the database to be access 02 and up. Does it?

Xhenkaii
0
 
LVL 34

Expert Comment

by:flavo
ID: 10865316
>> I cannot create a MDE file. It seem to require the database to be access 02 and up. Does it?

97 you can create an MDE (Tools - Db utilities - Create MDE), did it about 2 mins ago..

Cant say for sure about older versions

To make an exe you'll need to use a VB / C (or the like) front end
0
 

Author Comment

by:xhenkaii
ID: 10865430
I see... funny y i cant my MDE option is grey out...
Thanks for the info anyway pple.
0
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10865481
0
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10865490
you may also try this:

If the option to create MDE is greyed out you need to open the MDB file in exclusive mode. Go to file-open, click on the drop down box and choose open exclusive


cheers
0
 

Author Comment

by:xhenkaii
ID: 10865530
well found this on a site.hope its useful to people reading this thread.
 credits to sean who is the administrator there

Basics
Let me start with the basics of a stand-alone, runtime Access application. As we all know mdb files require that Access be installed on a computer to run. MDB files run in development mode by default but you can open them in runtime mode by creating a shortcut to open the database and adding the /runtime switch. The shortcut command line includes these elements: <path to msaccess.exe> <switches> <switch parameters(if any)> <path to database file>
So to open a database in runtime mode create a shortcut with this in its Target field:
"C:\Program Files\Microsoft Office\Office\msaccess.exe" /runtime "C:\My Documents\mydatabase.mdb"
Runtime
The runtime mode simulates how a database will work if used in conjunction with the Access Runtime version. The Access Runtime version is a freely dsitributable version of Access that allows you to open a database file but not to modify it. You must purchase a royalty free runtime license from Microsoft in order to legally distribute the runtime version of Access. This license is included with the Developers versions of Office.
The runtime version of Access allows you to make your Access database appear to be a completely independant application. Users wont even know that your software is an access database unless they dig into the installation directory and see the mdb/mde files.
Now comes the tricky part, Installation
Installation
The Office Developers Edition comes with the Access Setup Wizard (dont know what its called in OfficeXP) that is designed to create an executable file that installs your database, the runtime version of access and all required support files. Thats great in theory, but the MS Setup Wizard is a piece of junk. We wasted months and thousands of dollars working with it only to find out that even after all the bugs were fixed it interfered with other Access applications. So we scrapped it an found a company called SageKey software that sells an Access Runtime install script for use with Wise Install Builder or InstallShield (the 2 most commonly used install applications). All you have to do is install Office Developers Edition, Wise InstallBuilder (or InstallShield) the script from SageKey, then you can edit the script as you like (very simple script language and it is commented to tell you where to edit). then click the compile button in Wise and it creates a single EXE file. This is also a great advantage over the MS Install Apps becasue they create an exe file but it must be accompanied by about 30 other files. Wise creates just one file. That makes it easy to let customers download your app or a demo of your app.
Tips and Tricks
Actually I lied when I said that the Install App was the tricky part.. Creating an Access database that can be widely distributed is the tricky part. You have to take your error handling (idiot proofing) to a whole new level. But here are some tips and tricks you can use to develop your app.
1) Create a Bitmap image for use as a splash screen, name it the same name as the main database file and make sure it installs in the same directory as the main database file. Access will display your splash screen instead of the Access splash screen when the app starts.
2) Download Icon Easel or some other Icon creation software and create an ICO file for your App. It is a dead giveaway when the Access icon is displayed in the Title bar.
3) Create a Help File. The Help software that comes with Office Developers Edition kinda sucks, so I bought an inexpensive app called WinHelpDesign. You can create context sensitive Help files that associate forms, reports or even specific controls with a Help Topic. When the User asks for help, it will take them directly to the topic you associated to the form/report/etc.. WinHelpDesign will also export your Help file to HTML so you can post it on a website.
4) Make your database file MDEs. Unless you are selling the app as opensource where you allow customers to make changes, it is advisable to only distribute MDE files. That way customers cannot not accidentally modify anything (even if they open the file in the full version of access) and they cannot see your source code (or steal any of it).
5) Create a separate security file. The SageKey script is designed to do this already. Create a copy of the default system.mdw file and customize it if you want your users to be able to implement security. One of the (many) limitations in the runtime version is that users do NOT have access to the security settings. So, if you want to allow users to setup security, you will have to build an interface. (Im working on one now). You can predefine user groups in the new MDW file. That way all the user has to do is create a new user, assign a group and give it a password. Its very messy if they have to get into object level permissions.
Access security is a topic all by itself so Ill leave it at that
6) Add Management tools.
6.1)If you are going to enable the ability to install the app on a network, then you need to add some management tools to your app. For one, users need to have the ability to relink thier tables to the data file on the network. There is code in Northwinds that shows how to do this. It is a lot of code, most of it is used to generate a Browse window. So if you can think of a way to do this without using a browse window, it will be alot easier..
6.2) The SageKey script can install Repair and Compact shortcuts. I actually prefer to set a timer that will set the Compact on Close option every month. But you at least need a Repair shorcut for your main app file. You can create a button to Repair and Compact the data file (if you are doing a network enabled app).
6.3) Backup, Archive, Import Archive data options are always nice to have..not very difficult to add. And the ability to install an update. An easy way to do this is to just replace the front-end file. Of course you cant do that if it stores any important information so you would have to create routine that transfers database objects from an update mdb file..

I know thats alot to think about, my apps have evolved over a long period of time (based on user requests, etc..) but the work is well worth it.
0
 
LVL 8

Expert Comment

by:dds110
ID: 10868023
You can still "lock" the db down so that the users cannot get into the db objects (forms, tables, modules, etc...).

Create a new module and paste this code:

Sub SetStartupProperties()
    ChangeProperty "StartupForm", dbText, "YourFormHere"
    ChangeProperty "StartupShowDBWindow", dbBoolean, False
    ChangeProperty "StartupShowStatusBar", dbBoolean, False
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    ChangeProperty "AllowFullMenus", dbBoolean, False
    ChangeProperty "AllowBreakIntoCode", dbBoolean, False
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    ChangeProperty "AllowBypassKey", dbBoolean, False
    ChangeProperty "AppTitle", dbText, "Application Title Here vs1.2"
    Application.RefreshTitleBar
End Sub

Public Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Database, prp As Property
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    If ERR = conPropNotFoundError Then  ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, _
            varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function

The key line of code here is this

    ChangeProperty "AllowBypassKey", dbBoolean, False

This turns off the shift key.  It's a good idea to create yourself a back door by changing the line to this:

    ChangeProperty "AllowBypassKey", dbBoolean, True

You can put that on the Double Click event of a label.  You should try this out on a COPY of your database first.

This code does not prevent anyone from creating a new database and then importing all the objects from your database.

HTH
0
 
LVL 8

Expert Comment

by:dds110
ID: 10868054
oh yeah, my previous post is based on this comment

>>What i actually need to do is to create a deployable where only the GUI is accessible to the user
0
 

Author Comment

by:xhenkaii
ID: 10884522
dds110,

I've tried your code but it throws me a type mismatch error.
The error happens on this line:
dbs.Properties(strPropName) = varPropValue

and it throws the "type mismatch" on  
Set prp = dbs.CreateProperty(strPropName, _
            varPropType, varPropValue)

Just to retrace my steps. I created a module and copy paste ur sub and the public function into it. I've insert ChangeProperty "AllowBypassKey", dbBoolean, False into the form_load() of the switchboard. Right?

Xhenkaii
0
 
LVL 1

Expert Comment

by:sethspearman
ID: 10995978
If I can just add my two cents worth...

First to create BULLETPROOF runtime installation of Access apps using the Access Runtime Modules then look into buying preconfigured scripts from SageKey.com.  In order to do this legally you will need to be licensed for Office Developer Edition (Which I KNOW was available in all version of access from 97 to 2002.) and Wise Installation System ver 9.

Office Developer comes with some deployment options but they are not bulletproof.

If all you want to do is lock down the user interface (without using an MDE) you can download some rather chintzy free tools from my website at www.accesswizards.com/downloads.  (Hopefully you won't regard this as promotion since I make no money from the tools and they are not supporte).

Regards

Seth B Spearman


0
 
LVL 8

Expert Comment

by:dds110
ID: 11001472
xhenkaii,

you only need to run the code once.  After you have pasted the code into the new module (and saved it), place your cursor anywhere within the sub wrappers and press F5.  The next time you open the database, it should be locked down.  One caveat to this:  anyone can still create a new database and import all of the objects in your "locked down" db into the "new" db.

Now, for the error.  What does varPropValue contain and is it the right type for the corresponding varPropType?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 8

Expert Comment

by:dds110
ID: 11001479
sethspearman

I'd love to see your site but I can't get to it.  Server problems or could it be on my end?
0
 
LVL 1

Expert Comment

by:sethspearman
ID: 11001646
OOPS.

Got the URL wrong.  It should have been:

http://www.accesswizards.com/Downloads.html

The web site is old (I am doing a new one now) but that should work for you.

Seth
0
 

Expert Comment

by:Dman247365
ID: 11030728
Hey,
I found an url in which MSAccess 97 RunTime was incorporated.
Just download the zip file and install the 2 items!!!, otherwise MSAcces 97 runtime will not be installed!
http://habitat.pac.dfo.ca/pskf/version4_0/system/skmenu1.cfm
Select the url:
Download Data Entry Programs Include MSAccess Runtime Version (12MB) )
For extra Info:
http://habitat.pac.dfo.ca/pskf/version4_0/system/Instructions.htm
Remember, You have to install both items. Once installed you can delete the database that is in it and copy your Access mdb in it.
;-)
0
 

Expert Comment

by:Dman247365
ID: 11031137
Ok,
If you want to download the Runtime for Access2000...[StreetValue is Free ;)]
Here is the link,.. and it works Fantastic!

http://download.microsoft.com/download/office2000dev/art2kmin/1/WIN98/EN-US/ART2KMin.exe

Finally, there is an extra securitypatch You have to install... KB827431

http://www.microsoft.com/office/ork/updates/97_2000/art0901a.htm

0
 

Expert Comment

by:Dman247365
ID: 11043291
Last but not least...

Access 2002 Runtime Version.. Included in following Demo Pack
http://www.service.csrconsultants.net/DemoR.exe

Office XP Service Pack 3 (SP3) for Access 2002 Runtime
http://www.microsoft.com/downloads/details.aspx?FamilyID=a46ad6fa-4137-4ecc-8a78-7980b80b60ff&DisplayLang=en
0
 

Expert Comment

by:lallentx
ID: 11107881
regarding locking down the database, have try this.
go to tools/startUp/ then unmark the "display database window option"

also, I udnerstand you mihgt have to use the databse spliter. this creates a back-end a new database where all the table objects are stored along with the data. it then creates a front-end (this is the part the the users can see) here the query, form and reports objects are stored.

the spliter also links the front-end to the back end.
( moved my back end to the SQL server and the front end is an .mde file in a file server, works great!!)

you can then create the .mde

if the database is open the .mde option will be gryeded out. to create the .mde the database has to be closed. open access but do not call the database. Also if the database is a different version that the version of MS Access in your system the .mde option will be grayed out. both MS access and the database must have the same version.
you might want to consider converting your databse before starting any of this work.

hope it helps.
0
 

Expert Comment

by:dairolozano
ID: 11286141
Ok,
If you want to download the Runtime for Access2000...[StreetValue is Free ;)]
Here is the link,.. and it works Fantastic!

http://download.microsoft.com/download/office2000dev/art2kmin/1/WIN98/EN-US/ART2KMin.exe
----
Thoug I consider the idea of downloading this demo and distributing it with my .mde really exciting,I think is not legal. So, If you will distribute a pirate version of your file, it will be as illegal as if you installing a pirate Office XP copy.
0
 

Expert Comment

by:yogi1945
ID: 13206969
After downloading ART2kMIN.exe and extracting 377 files, I was able to run a test .MDE file on a non-MSOffice system via the commandline.  After un-installing MSAccess Runtime and later re-installing on the same machine, I then got a "MSAccess is not licensed for usage on this PC" message.  Any ideas to resolve this ?
0
 

Expert Comment

by:Dinamit
ID: 14050992
Does anyone found the way that convert .mde to .exe file?
0
 

Expert Comment

by:Dinamit
ID: 14051004
and..

Comment from lallentx
Date: 05/19/2004 06:54AM PDT
 Comment  
regarding locking down the database, have try this.
go to tools/startUp/ then unmark the "display database window option"
 
I made this. So how can I re gain My menus?
0
 

Expert Comment

by:DocZayus
ID: 14700282
F11
0
 

Expert Comment

by:mikotron
ID: 37956681
I am using the mde compiler utility to convert my mde to exe

Found here.. www.mdecompiler.com

Hope this information can be useful
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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 …

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now