Private Database

The private database option lets the user access and update records in a private copy of the application database. The information is private because any changes to the database records made by the user are not accessible to other users. This allows information to be validated and confirmed prior to its incorporation into the application database. The changes made to the private database are not made public until the program explicitly updates the database in one of two ways:

Secure changes A procedure uses the option to secure the changes
Save/Exit menu A procedure of the type Save/Exit menu is used to save the changes

A Save/Exit menu prompts the user either to accept the changes made so far or to abandon them. The Save Changes option updates the records from the private database to the application database. The Abandon Changes option cancels the database update, so any changes are discarded.

The Esc option causes the menu to disappear with no action. One of the save or abandon options must be selected in order to exit.

If your program does not secure changes before exiting, and a Save/Exit menu is not presented, any updates will be lost.

The first figure below shows User A and User B adding records to the application database. The second figure shows the result of securing the changes to the application database.

 

Private Database 

 

User A   User B

 

User A adds 5 records, and User B adds 3 records. These remain private to the individual users until the records are updated to the application database.

 

Application Database - Public

To set up a private database:

  1. In the Program Summary answer yes to Private Database Update ?
  2. Set up one or more procedures to use the private database which do not secure changes. At the end of the processing, you will need one procedure to update the application database

To set up a procedure body to access and update the private database:

  1. In the Procedure Overview answer yes to Update database ? and no to Secure changes ?
  2. In the main table processing answer yes to Update main table ?

To update the application database with user confirmation:

Select the Save/exit menu procedure body type in the Procedure Overview. This selection causes the Save/Exit menu to be displayed to enable the user to accept or reject the changes

To set up a procedure to update the application database without user confirmation:

  1. In the Procedure Overview answer yes to Database procedure ? and Update database ? Answer no to Confirm updates ? and yes to Secure changes ?
  2. Set up the table processing

Abandon Changes

You have the option to throw away changes to a private database automatically, without user intervention. Do this by setting the standard variable abandon_changes to TRUE before or during a procedure which secures changes. This makes your program behave as if the user selected the menu option Abandon changes.