Developing a Database Application:
The dB2K Tutorial

Ken Mayer, Senior SQA Engineer, dBASE Inc.
Michael Nuwer, dB2K user
Last Modified: October 13, 2001
Version 2.2.0


The Purpose of this Tutorial

dB2K is a great rapid application development (RAD) environment. Unfortunately, many folk new to dB2K are not sure where to start in the development of an application or how to use the tools included with this amazing software.

The purpose of this tutorial is to guide a database developer through the process of creating an application in dB2K, from building the database to it's final deployment.

dB2K is a 100% pure object-oreinted programming tool. The tutorial project will focus on using the dB2K data access objects; it will guide you through the objects used to create forms, reports, and an application menu; and it will show you how to build and deploy a complete application.

This process will take some time, so this is broken down into individual parts. As a student you can work along when you have time and come back and pick up where you left off. Do not assume that you can just "whip through it" and be done quickly. While the application created during the process of this tutorial is not a "complete" application, it still has many inter related pieces. In the past, users have, for the most part, taken a minimum of one week to complete this project.

New to the Second Edition

This is the Second Edition of the Tutorial Project. The first edition was written for Visual dBASE 7.01 by Ken Mayer and last updated November 8, 1999. The text of the Second Edition is a complete face lift so that it corresponds with the many new features offerd by dB2K. The updates were made by Michael Nuwer and released June 30, 2001. Among the new features found in dB2K are dQuery/Web, Source Code Aliases, and Dynamic External Objects (DEO). The Second Edition integrates each of these new technologies into the Tutorial Project.

Another significant change that will be appearent to anyone who has worked through the First Edition of the Tutorial is the addition of a new Chapter on Creating Custom Components. In the First Edition, the Tutorial used a pre-created set of custom controls. In this Edition you will create your own custom controls and use them in the application.

Other new material includes a brief discussion of data validation and creating calculated fields in the Chapter on "Creating the DataModules". A new report, the Customer Account Statement report, is added to the Chapter on "Creating the Reports". This report offers some interesting material related to the linkage tables and calling the report.

Other changes include 1) the use of DataModule objects rather than DataModRef objects and 2) the use of TextLabel objects rather than Text objects. Both the DataModule class and the TextLabel class were introduced in February 2000 when Visual dBASE 7.5 was released. The DataModule class reduces much of the complexity associated with dataModRef objects and the textLabel class reduced the memory overhead associated with Text objects.

The Project Explorer is no longer included in the Tutorial. With the introduction of DEO, compiling and building an application has become rather simple. The Project Explorer is, therefore, no longer needed.

For those who have paid very close attention to the code used in the First Edition, you will notice that the canClose method that was in the DataForm.cfm has been moved to base.cfm. Since the DialogForms and the Dataforms were calling this method, it seemed appropriate to locate it so that either form would inherit it.

Updating the Second Edtion

dB2K is a very dynamic product. You should expect to see changes in this development environment, and you should understand that the changes will be made many times a year. This poses problems for the Tutorial Project because it contains a lot of step-by-step instructions. Over time these instructions will become less and less accurate.

For this reason, we have adopted a versioning system for the tutorial. As changes are made to the document the version number will be modified to inform the reader of the updates.

NOTE: If you find any typos, errors, or have a difficult time understanding any part of this tutorial, please use the dBASE, Inc. public newsgroups. Information on these can be gotten at the dBASE, Inc. website: Use the "Help" link, and at the top of the Technical Support page is a link to a webpage that explains how to use the dBASE newsgroups.

Special Thanks

There are many people who have helped with this Project. The First Edition would not have been completed without:

In addition, there were many folk who helped test the tutorial before the First Edition was released to the general public. Ken received some good comments from various Beta testers, including a lot of re-writes for clarity in the text, a lot of the "Notes" were added based on input from the testers, and some (gasp) bug fixes in the code. These tester were: Robert (Bob) Newman (Bob found a really serious problem in the deployment section of the tutorial, as well as lots of good commentary throughout ...), Richard Sandies, Frank Polan, Barbara Betcher (Barbara suggested the Goals section for each of the different Phases of the tutorial, and provided screen shots for some of the areas she had concerns over -- this was very helpful), Steve Robertson, Denise Allred, Richard Clark, Bernard Mc Clement, Richard Forrest, and Jørgen Feder. The second group of Beta tester were Roy Manuell, Santo Lo Galbo (Santo tested on the Italian version of Visual dBASE 7, and it worked there, which is good to know), Gerald Lightsey (Gerald provided tons of nit-picky commentary -- which is good -- various typos and minor glitches got found, as well as a few big ones, particularly in the Invoice report), Wes Rue (the first to complete the project through to the end), and Jim Garrett.

The Second Edition of the Tutorial owes a great deal to the dBASE community. Over the last few years that I have been active in the dBASE Newgroups, I can not remember one cross word directed at "Ken's Tutorial". But there has been a ton of praise and graditure. The overwhelming support of the user community voiced day after day both encourged and energized this update.

Ken Mayer encourged Me (Michael Nuwer) to write the update and had faith that I could pull it off. The Second Edition of the Tutorial also benefited from a great group of testers. Tim MacAlpine set the pace during the testing period. He was often the first to find my errors and cleared the path for others. Barbara Betcher, who was a beta tester for the First Edition, offered her help again. The clearity of this document owes much to her detailed comments. Duane Bays and John Creed brought a great deal of experience to the testing period. Their extensive comments saved me from making some big mistakes. I would also like to thank Mario Trzesniowski, Don Archibald, Jean Chenaille, and Don White for offering valuable contributions to this project.

Proceed to the next part of the tutorial: Introduction
Go back to the tutorial menu

The Legal Stuff: This document is part of the dB2K Tutorial created by Ken Mayer. This material is copyright © 2001, by Ken Mayer. dB2K is copyrighted, trademarked, etc., by dBASE, Inc., the BDE (Borland Database Engine) and BDE Administrator are copyrighted, trademarked and all that by Borland, International. This document may not be posted elsewhere without the explicit permission of the author, who retains all rights to the document.