Microsoft KB Archive/205151

= MOD2000: How to Distribute a Secured Database =

Article ID: 205151

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition
 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q205151



This article applies only to a Microsoft Access database (.mdb).

Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
When you distribute a secured database as a run-time application, you must take certain precautions to ensure that you can install the application on another computer. This article lists the steps that you should follow to distribute a secured database.



MORE INFORMATION
When you distribute a run-time application to users who have Microsoft Access 2000 on their computers, you should take several precautions to protect the database. To prevent users from making modifications to the objects and code or from inadvertently causing problems with the application, consider these recommendations:
 * Specify the /runtime switch on all command lines that you use to start the application.
 * Use the User Level Security Wizard that is provided with Access 2000 to secure all the objects in the database.
 * Use customized menus and toolbars within the application.
 * Set the AllowBypassKey property to False to disable the SHIFT key.
 * Set database Startup properties to prevent users from accessing the Database window and the design of objects.
 * If the database contains Visual Basic for Applications (VBA) code, compile and save all code, compact the database, and from the results, make an MDE file.

After considering these recommendations, follow these steps to distribute your run-time application:  Open your MDB or MDE file in Access 2000, and enter a user name and a password when you are prompted. On the Tools menu, point to Macro, and then click Visual Basic Editor. In the Visual Basic Editor, click Package and Deployment Wizard on the Add-ins menu.

NOTE: If the Package and Deployment Wizard does not appear on the Add-ins menu, click Add-in Manager instead, and in the Add-in Manager dialog box, click the VBA Package and Deployment Wizard, click to select the Loaded/Unloaded and the Load on Startup check boxes, and then click OK. On the first page of the Package and Deployment Wizard, click Package. Click Standard Setup Package, and then click Next. Choose a path to the Package folder, and then click Next.</li> If you are presented with a Missing Dependency Information dialog box, handle appropriately, and then click OK.</li> Click to select the Include Access Runtime check box, and then provide access to the ODETools\V9\Runtime folder.</li> Click Add, and in the Add File dialog box, click All Files (*.*) in the Files of type list. Browse to the folder that contains the secured .mdw file, select the file, click Open, and then click Next.</li> Enter an Installation title, a command to run (if you want), and then click Next.</li> Determine your startup menu group and item. Click to highlight the item, and then click Properties. Note the Target property similar to the following, where is the actual name of your database:

"$(AppPath)\ .mdb"

</li> Change this property as follows, replacing with the actual name of your secured workgroup file and replacing with the actual name of your database. Then, click OK and Next.

/wrkgrp "$(AppPath)\ .mdw" "$(AppPath)\ .mdb"

</li> Modify any Install Locations if you want, and then click Next.

NOTE: If you change the Install Location for your secured workgroup file, make sure you go back and change the Target property as described in the preceding step.</li> Click to select the files that you want to install as shared files, and then click Next.</li> Enter a script name, and then click Finish.</li> After the package is created, save the packaging report if you want, and then click Close.</li> Click Close again, close the Visual Basic Editor, and then quit Microsoft Access.</li> Share your Package folder or copy the folder to a compact disc (CD).</li> On a clean Microsoft Windows-based computer (a computer that does not have Microsoft Access installed), install the run-time application from the shared Package folder or CD.</li> After it is installed, start the application. If the application is installed correctly, the user should be prompted to first enter a name and a password before the application opens. If this does not occur, make sure that the run-time application is pointing to the secured MDW file. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Start the Workgroup Administrator (Wrkgadm.exe) utility.</li> Click Join, and then join to the secured MDW file.</li> <li>Quit the Workgroup Administrator, and then restart the run-time application.</li></ol> </li></ol>

<div class="references_section">