Microsoft Office 2000 Developer |
Developing Microsoft Access Run-Time applications for distribution is similar to developing standard Microsoft Access applications. You have great flexibility in choosing a strategy for developing your application. For example, you can create your application's tables and queries, then its forms and reports, then its macros and modules. Or you can develop your application feature by feature, creating a variety of objects as you go along. To manipulate the objects you create, you can use macros, Visual Basic for Applications code, or a combination of both.
For more information about using the Access Run-Time in your applications, see:
Regardless of your strategy, there are several basic steps that you should follow when developing a Microsoft Access Run-Time application for distribution.
If you need to secure any objects or provide security features in your application, follow the guidelines described in Chapter 18, "Securing Access Databases" in the Microsoft Office 2000/Visual Basic Programmer's Guide.
Run-time applications have the same system requirements as Microsoft Access or Microsoft Office.
Because some standard Microsoft Access features are hidden or disabled in the run-time environment, you should make sure your application works correctly in the run-time environment before distributing it.
If you have the Microsoft Office 2000 Developer tools installed, you can test and debug your application in Microsoft Access by using the Microsoft Access /runtime startup command-line option to turn off full Microsoft Access features and simulate the environment in which users will run your application. Your application will look and behave as if your Windows registry contains the run-time licensing key. However, the /runtime option does not secure your application. Any user who wants to could either remove the /runtime option from the shortcut or start Microsoft Access directly to access the design of your application's objects.
Tip If Microsoft Access is installed on a user's machine, you can test your run-time application by copying the file mso9rt.dll to the user's ..\Program Files\Common Files\Microsoft Shared\VBA\VBA6 folder.
Also, for this method to work, your application must have a startup form that provides access to all the objects you want available (a main switchboard form), because you can't display the Database window in run-time mode. For more information about the behavior of the run-time environment, see Differences Between Full Microsoft Access and the Run-Time Environment.
You can specify the /runtime command-line option by clicking Run on the Start menu or by creating a shortcut.
To create a shortcut to start your application with the /runtime option
For example, the following command line starts Microsoft Access and then opens the Developer Solutions sample application in run-time mode.
"C:\Program Files\Microsoft Office\Office\MSAccess.exe" "C:\Program Files\Microsoft Office\Office\Samples\Solutions.mdb" /runtime
Note If you are working on a network that supports universal naming convention (UNC) paths (\\ServerName\SharedFolder), you can specify the location of the database without specifying a mapped drive letter. For example, you can copy your database to a shared network folder and define the shortcut's command line to open the database from that location by using the UNC path.
Users of your application work in an environment that combines the built-in features of Microsoft Access with the objects that you create. Unlike applications created with Microsoft® Visual Basic® or Microsoft® Visual C++®, applications created with Microsoft Access aren't compiled into a single executable file. Microsoft Access applications work by running your application’s database file (.mdb) in the Microsoft Access Run-Time environment with user profiles, which are stored in the Windows registry.
While a Microsoft Access application is running, it may not be apparent which elements of the environment your application supplies and which elements the run-time environment supplies. Because your application has its own look and feel, it may not even be apparent that Microsoft Access is running. Although Microsoft Access Run-Time applications are identical in most respects to full Microsoft Access applications, there are some differences that can affect how you design and develop them:
Note If your application uses dynamic data exchange (DDE), you can specify either Microsoft Access or the application name specified by the AppDDEName user profile setting as a valid DDE application name. The run-time environment will respond to both.
When your application is installed on a user's machine, an entry that causes Microsoft Access to open in the run-time environment is made in the software licensing section of the Windows registry. The setup program you created with the Package and Deployment Wizard automatically makes the necessary modifications.
When Microsoft Access or your run-time application starts, it checks the licensing key to determine whether to open the database in full Microsoft Access or in the run-time environment. If the application opens in the run-time environment, certain Microsoft Access features are disabled and/or hidden from the user.
If no licensing key is present in the Windows registry, your run-time application will not run.
When you distribute your run-time application to users who have Microsoft Access 2000 on their machines, you should take several precautions to protect your database. The following recommendations will prevent users from making modifications to your objects and code or inadvertently causing problems with your application.
For more information, see "Securing Office Solutions" in the Microsoft Office 2000/Visual Basic Programmer's Guide. For more information about MDE files, see "About MDE Files" in the online documentation for Microsoft Access.
When you use the Package and Deployment Wizard to include the Access Run-Time in your application, a message prompts you to locate the Access Run-Time files.
The Access Run-Time is not installed to your machine as part of the Microsoft Office 2000 Developer setup. Instead, you can find it on the Microsoft Office 2000 Developer CD in the Access Runtime folder. To avoid having to use the CD each time you package the Access Run-Time, you can copy the necessary files to your machine.
To copy the Access Run-Time to your machine
..\Program Files\Microsoft Office\ODETools\V9\Runtime