ODE: Avoiding Common Mistakes Creating Distributable Run-Time Applications

This article was previously published under Q180284
This article has been archived. It is offered "as is" and will no longer be updated.
Advanced: Requires expert coding, interoperability, and multiuser skills.

SUMMARY
The process of creating a distributed run-time application is explainedstep-by-step in the "Developing a Run-Time Application" Help topic (clickthe Contents tab in Microsoft Office 97 Developer Edition Tools Help, and then click to expand the Microsoft Office 97, Developer Edition Tools topic). This article lists available resources and troubleshooting steps that you should use to avoid making common mistakes when you create a custom application.

Things to Consider When You Create and Distribute a Run-Time Application

When you create and distribute the run-time application, consider thefollowing questions:
  • How was the application created?
  • Was the application tested and debugged?
  • Were Help files and topic files created?
  • Was the application tested in the run-time environment?
  • Were disk images created by using the Setup Wizard?
  • Was the application packaged and distributed?
The following sections contain more information about these questions.

How was the application created?

Before you can consider the application finished, answer the followingquestions:
  • Did you develop a plan?
  • Did you build the application around forms?
  • Did you include error handling?
  • Did you create custom menu bars and toolbars?
  • Did you add startup options?
  • If security is required, did you properly secure the application?

Did you develop a plan?

The first step in the process is to develop a design for the application.Make sure you have answered to the following questions:
  • Was the application secured? If so, how?
  • Was the database split? If so, how?
  • Will the application be run from a network? If so, how?
  • What is the best way to update the application after it is distributed?
For more information about the things to consider when you create a customapplication, please see the following articles in the Microsoft KnowledgeBase:
162584ADT/ODE: Developing a Plan to Deploy Run-Time Applications
162522Issues when you redistribute an Access application as a split database application
169813OFF97: Not All Files Can Be Distributed Using Setup Wizard
163535ODE97: List of Files You Can Redistribute with ODE Run-TimeApplication
179318ACC97: How to Simulate Office Features in an ODE Application

Did you build the application around forms?

In general, it's a good idea to build your application around forms. Usersshould interact with the application through the forms that you createinstead of the underlying queries or tables. By building your applicationaround forms, you can control the following:
  • The commands that are available to users.
  • The flow of the application.
  • The appearance and behavior of the application.
  • The way that users access data.
  • The way that data is displayed.
For more information about using forms in the application, click theContents tab in Microsoft Office 97 Developer Edition Tools Help, click to expand the Microsoft Office 97, Developer Edition Tools topic, click to expand the Developing a Run-Time Application topic, and then click to view the The Importance of Using Forms in Your Run-Time Applicationtopic.

For more information about form features that you cannot include in yourcustom application, please see the following article in the MicrosoftKnowledge Base:
172090ODE97: Filter-By-Form Not Available in Run-Time Applications

Did you include error handling?

It's important to include error-handling code in the application's VisualBasic for Applications procedures. When Microsoft Access encounters VisualBasic run-time errors that are not handled, it closes the applicationwithout displaying any error messages.

Microsoft Access also closes the application without displaying any errormessages if it encounters any run-time errors in the application's macros.However, you cannot trap errors in macros. If you want to ensure that yourapplication traps run-time errors, use Visual Basic procedures instead ofmacros.

NOTE: Avoid using the End statement in the run-time application. The End statement closes the application without producing a trappable run-time error.

For more information about implementing error handling and handling run-time errors in the application, see Chapter 8, "Handling Run-Time Errors,"in Building Applications with Microsoft Access 97.

Did you create custom menu bars and toolbars?

To prevent users from making changes to the application, the run-timeenvironment removes several menus and commands from the menu bar. Forexample, the View, Tools, and Format menus are removed from all windows. Commands on the Edit, Insert, and Records menus are also removed from themenu bars in the Datasheet view of tables and queries, the Form view, andPrint Preview.

You must control the menus and commands that are available to users of theapplication by building the application around forms that have custommenus. The run-time environment disables all built-in Microsoft Accesstoolbars. However, even though the run-time environment does not supportbuilt-in toolbars, you can add your own custom toolbars to the application.When you create a custom toolbar, it is stored in the current database. Itis automatically available to the application.

For more information about creating custom menu bars and toolbars, pleasesee the following article in the Microsoft Knowledge Base:
159692ACC97: How to Create Command Bars Using Visual Basic Code

Did you add startup options?

You can set the following startup options for the custom application:
  • Application title
  • Application icon
  • Name of Custom menu bar
  • Name of startup form

If security is required, did you properly secure the application?

When you distribute the run-time application to users who have MicrosoftAccess 97 on their computers, you should take several precautions toprotect the database. To prevent users from making modifications to theobjects and code, or from inadvertently causing problems with theapplication, consider these recommendations:
  • Specify the /runtime option on all command lines that you use to start the application.
  • Use the Security Wizard that is provided with Microsoft Access to secure all the objects in the database.
  • Use customized menus and toolbars in the application.
  • Set the AllowBypassKey property to False to disable the SHIFT key.
  • Set any database startup properties that could potentially give users access to the Database window or any Design view.
  • If the database contains Visual Basic code, distribute it as an MDE file.
For more information about securing the application, please see BuildingApplications with Microsoft Access 97, in Chapter 14, "Securing andDelivering Your Application."

Was the application tested and debugged?

When you program an application, you must consider what happens when anerror occurs. An error can occur in an application for either of tworeasons. The first reason is that some condition at the time theapplication is run causes the otherwise valid code to fail. For example, ifthe code attempts to open a table that the user has deleted, an erroroccurs. The second reason is that the code may contain improper logic thatprevents it from doing what you intended. For example, an error occurs ifthe code attempts to divide a value by zero.

If you have not implemented error handling, Visual Basic halts executionand displays an error message when an error occurs in the code. The user ofthe application is likely to be confused and frustrated when this happens.You can forestall many problems by including thorough error-handlingroutines in the code to handle any errors that may occur.

When you add error handling to a procedure, you should consider how theprocedure routes execution when an error occurs. The first step in routingexecution to an error handler is to enable an error handler by includingsome form of the On Error statement in the procedure. The On Error statement directs execution in event of an error. If there's no On Error statement, Visual Basic simply halts execution and displays an error message when an error occurs.

When an error occurs in a procedure that contains an enabled error handler,Visual Basic does not display the normal error message. Instead, it routesexecution to an error handler if one exists. When execution passes to anenabled error handler, that error handler becomes active. Within the activeerror handler, you can determine the type of error that has occurred andaddress it in a manner of your choosing. Microsoft Access provides twoobjects that contain information about errors that have occurred, theVisual Basic Err object and the DAO Error object.

For more information about implementing error handling and handling run-time errors in the application, see Chapter 8, "Handling Run-Time Errors,"in Building Applications with Microsoft Access 97.

For more information about routing execution when an error occurs,the On Error statement, the On Error Resume Next statement, and the Resume Statement, search the Help Contents for "The Importance of Error Handling in Your Run-Time Application," and then view the topic "Elements of Run-Time Error Handling."

Were help files and topic files created?

Your application should use its own Help file rather than the fullMicrosoft Access Help file (Acmain80.hlp). If you want to provide Help foryour run-time application, you must create your own Help file, and then setthe AppHelpFile key in the Windows Registry. You can also provide topic IDsfor your Help file so that you can create context-sensitive help for yourtopics. Microsoft Office 97 Developer Edition includes a Help Workshop toassist you in creating custom Help files, and the Setup Wizard to assistyou in setting the AppHelpFile registry key when you create your Setupfiles.

For more information about creating your own Help files, please see thefollowing articles in the Microsoft Knowledge Base:
171958ODE97: Tips for Creating and Compiling Your Windows Help File
175491ODE97: Step-by-Step Example of Creating/Compiling a Help File
163939ODE97: Help Workshop Help Topics Contents
177107ACC97: Displaying Context-Sensitive Help for What's This Button

Was the application tested in the run-time environment?

You should always test and debug your application on a clean computer. Thiswill ensure that when you package your application you are including allthe files that you need to successfully run your application. To test yourapplication on a clean computer follow these steps:
  1. Run your Setup program on a clean computer. This should be a computer that does not have any of the components that you are including with your custom application.
  2. Back up your Windows and Windows/System folders.
  3. Test your application.
  4. Delete the application.
  5. Delete everything in the Windows and Windows/System folders.
  6. Restore Windows and Windows/System folders from the backup.
For more information about testing your application, please see thefollowing article in the Microsoft Knowledge Base:
162584ADT/ODE: Developing a Plan to Deploy Run-Time Applications
For more information about errors that you may encounter when testing yourapplication, please see the following article in the Microsoft KnowledgeBase:
119754ADT/ODE: Compile Error When Running ADT or ODE Application

Were disk images created by using the Setup Wizard?

When your custom application is complete and ready to distribute to users,you need a way for users to install it. Microsoft Office 97, DeveloperEdition provides the Setup Wizard, which helps you create a custom Setupprogram for your application.

When you run the Setup Wizard, you answer questions about the files thatyou want to copy to users' hard disks, the Microsoft Access features thatyour application requires, and how the Setup program should customize theinstallation of your application. Then the Setup Wizard compresses yourapplication files and groups them so you can copy them to floppy disks orto a network drive. If your users do not already have Microsoft Accessinstalled on their computers, the Setup Wizard can create an installationthat includes the run-time version of Microsoft Access.

The Setup Wizard compresses and groups files based on your choices andcreates a custom template that the Setup program will use to install yourapplication.

NOTE: If you choose Network Installation when you create your disk images, remember that the user must connect to the folder or directory in which the files are stored to run the Setup.exe file. This means that the folder must be shared. In a Windows NT or a Netware environment, the user must also have the necessary permissions to run the Setup program and copy files.

For more information about Network permissions, please see the followingarticle in the Microsoft Knowledge Base:
136140ACC: Permissions Needed for Workdir Folder
For more information about using the Setup wizard, please see the followingarticle in the Microsoft Knowledge Base:
162884ODE97: Troubleshooting ODE Setup Wizard Problems

Was the application packaged and distributed?

After your Setup program is complete, you're ready to distribute yourapplication. To install your application, users can simply run the Setupprogram file included on your floppy disk or in your network installationfolder.

For more information about installing your custom application, please seethe following articles in the Microsoft Knowledge Base:
170695ODE97: How to Resolve Path/File Access Error in Setup Wizard
177590ADT/ODE: Setup Not Completed Successfully Installing CustomApplication
176018ODE97: ODE Setup Wizard Error "Setup Error 825"
161403ADT/ODE: Err Running Setup If More Than 40 Registry Keys Defined
135382ADT/ODE: File Compression Ratio Less Than Other Programs
121959ADT/ODE: ADT/ODE Application Setup Always Defaults to Drive C
165630ODE97: Files Added to the Disk Images by the ODE Setup Wizard
NOTE: If you want to modify your custom Setup program after running the Setup Wizard, or if you need to update files included in your application, run the Setup Wizard again. On the first page, choose the option to use previously saved setup options, and then specify the template file you saved in a previous Setup Wizard session.
inf
Properties

Article ID: 180284 - Last Review: 12/05/2015 08:21:19 - Revision: 4.1

Microsoft Office 97 Developer Edition

  • kbnosurvey kbarchive kbhowto KB180284
Feedback