Desktop Database

Description

An Alpha Anywhere User Guide to the Desktop.

Name
Description
About Alpha Anywhere

At Alpha Software our mission is to build cutting edge database software that enables our customers to build breakthrough applications and solve database management problems rapidly and easily.

Addin Manager

Background information on using the addin manager and using the addin manager.

Adding a Global Image to Your Workspace

You can store bitmap images in the workspace (e.g., in the ALB file). The bitmaps are shown on the Code tab in the Control Panel. The advantage of storing the bitmaps in the workspace is that the bitmap files will be copied when you copy the workspace. You can insert icon bitmaps (ICO files) into your workspace from the Windows Explorer by dragging and dropping the ICO file into the Alpha Anywhere Control Panel.

Adding Tables or Sets to a Workspace

You can add an existing table, perhaps previously created in another Alpha Anywhere workspace, or some other program, to your current workspace.

Aliases

Aliases let you create transportable applications. An "Alias" in Alpha Anywhere refers to a name you assign to represent a local directory on a computer where workspace information is stored. You can define file aliases on the Aliases tab in the Settings dialog. For example, the alias image_folder can refer to c:\images\ on one user's machine, and d:\data\images on another machine. Aliases are particularly useful if you use Image File Reference fields, which store image filenames in the field rather than the image data.

Appending Selected Records from another Table

You may append selected records from another table to the current table using the Append Operation or when viewing a table through a form or browse. To append records:

Attaching a Library to the Current Workspace

To attach an external library to the current workspace:

Automatic Recovery of Indexes

The following two scripts allow a user to take a snapshot of all of the indexes in all of the tables in their application, and then check the actual indexes against the index definitions stored in the snapshot. Script 1 loops through all of the table in a database and stores the index definitions in a text file on disk. The text file is the same as the Database name but it has a ".TableInformation" extension. You would run Script 1 only once. Script 2 retrieves the index definitions and checks the indexes in the tables against the saved index definitions.

Backup Workspace

Alpha Anywhere lets you create a backup of your workspace, and to restore a previously backed up workspace. To back up a workspace:

Cannot Refresh Database Problem

When Alpha Anywhere is refreshing a shadow database, it creates a file named after your database (.ADB file) by appending "LOCK" to the filename.

Clearing the Record Filter

This demonstration of Action Scripting adds a button to the Edit_Customer_Info form. This script will remove any restrictions to the records that the form displays.

Compacting the Workspace

When designing forms and reports, the size of the data dictionaries (the DDD and SET files) grows over time as you continue to make edits to the objects in your workspace. It is a good practice to periodically remove the extra bulk by compacting the workspace. The Workspace Compact command packs all tables and compresses the data dictionary files. You can check the size of the workspace before and after compacting to see the file size reduction. You can also select to compact the workspace when you back it up. To compact a workspace:

Desktop Applications - Counting Number of Users of An Application

A Desktop Application can be in use by users of the full version of Alpha Anywhere and the Runtime Version of Alpha Anywhere. To get a count of the total number of users who are using the application you need to know how many Runtime users are using the application and how many Full Version users are using the application.

Creating a Workspace

In this lesson, you learn about designing a workspace application. You create a new workspace and workspace tables, and learn about defining data fields.

Creating Periodic Backups

You can provide an Alpha Anywhere setting to create weekly workspace backups. If your workspace gets very frequent use, you might want to back it up daily. To create periodic backups:

Workspace Specifications

Covers categories, tables/fields, indexes, layouts, saved settings, queries, and expressions that relate to workspace specifications.

Disallow Edits

The Disallow Edits action prevents the user from making any changes to records in the specified form or browse window. If the data entry style is set to modal, then edits will automatically be disallowed after the record is saved.

Dropping Tables or Sets from a Workspace

To remove a table or set from a workspace:

Exporting Selected Records from a Table

You may export selected records from the a table using the Export Operation or when viewing a table through a form or browse. To export the current selection of records:

Expression Library

The Expression Library stores expressions that can be inserted into your script with only a couple of keystrokes.

Filtering Records to Include Multiple Field Values

This demonstration of Action Scripting adds a button to the Edit_Customer_Info form. This script will restrict all the records that the form displays to those where "CT", "MA", "ME", "NH", "RI", or "VT" is the value in the Bill_State_Region field.

Font Equation Genie

The Font Equation Genie guides you through creating logical expressions for determining font face and size, as well as text decoration for a field. Each row represents one expression. You can use multiple rows to set several different Font Equations for the same field, which are evaluated in the same order which they appear in the Genie.

Global Scripts

Alpha Anywhere allows you to create Global Scripts. These are scripts that are not attached to any form buttons or events. Global Scripts are shown in the Code page of the Control Panel and they can be played back directly from the Control Panel by double clicking on the script name. Global Scripts can also be called by another script using the SCRIPT_PLAY() or SCRIPT_SPAWN() command. For example, the script that is attached to a button on a form might include this command:

Go to Record Number

The Go to Record Number action displays a specified record number based on the current index/query order. This option is a staple part of record navigation.

List View Genie

The List View Genie allows you to present a user with either an attractive, well formatted, and easy-to-use static list of choices or a dynamic list of choices and return the user's selection. You can:

Managing Addins

Background information and using the addin manager:

Marking and Deleting Selected Records in a Table

Covers marking, unmarking, and deleting records

Moving Selected Records to another Table

When you are viewing a form or browse, you can move the currently selected set of records.

Multi-User Architectures

In an environment where the Alpha Anywhere application is fully developed, the simplest multi-user architecture has multiple client PCs, each with a Runtime license, and a PC acting as a server. Depending on performance considerations, the server PC could be one of the client PCs. A "N" user license defines the maximum number of concurrent users. If you purchase a 3 user Runtime license, you may have a maximum of 3 concurrent users. However, the Runtime software may be installed on more than 3 (for example, 5) client PCs. Only 3 of those 5 users may be active at any one time. A 3 User Runtime Configuration with a Shared Database and No Development Capabilities:

Network Optimization

There are a number of issues relating to network optimization including how it works, dealing with files copied by network optimization, optimization options and how to customize optimization, refreshing a shadow database, and what you should do after creating a shadow database.

Numbering Child Records

Many applications create a set with a parent table in a one-to-many relationship with a child table. Field Rules auto-numbering can assign unique ID numbers to the records in the parent table. The problem of numbering the child table records is cannot be solved with Field Rules, particularly if you want to reset the child record counter to 1 for each new parent record. For example, the solution might provide the following record numbers:

One-Step Backup

Alpha Anywhere allows you to backup your database with a single menu selections by selecting the Tools, Backup/Restore Database, One-step Backup command. Before you can run a one-step backup, you must first have saved backup settings. To save backup settings:

Optimizing Performance of Advanced Record Lists

If you are displaying a record list for a large table, you can optimize the performance of the record list by constructing an index with the keylist_expression. If you have an index for the keylist_expression, the syntax for the advanced drop-down record list becomes:

Pack Tables

You pack a table if there have been design changes (changes to the data dictionary) or you have deleted records that you want to permanently remove. The Pack Tables action allows you to pack tables in your database. This will delete records marked for removal and compress memo files.

Preparing a Runtime Installation to use a Shadow Workspace

This technique describes how to run the initial network optimization after a user installs a runtime application on his computer. It involves creating a "Bootstrap" application. Here is how to create a "Bootstrap" application.

Record List - Combo Box Table Lookup

The Record List - List Box tab of the Table Lookups form contains two list boxes.

Record Locking

Alpha Anywhere places a lock on a record when:

Renaming Workspaces

A workspace consists of several files. They have the same prefix as the workspace, and have the extensions: .ALB, .ALX, .ALM, and .ADB To rename a workspace

Restore a Workspace Backup

In Alpha Anywhere the Restore Workspace utility supports dates in MM/DD/YY formats.

Select Workspace Dialog

The Select Workspace dialog appears when you start Alpha Anywhere. Here you can select what you want to do, and quickly get started. The Workspace &Tasks tab allows you to open or create a new workspace.

Send Workspace

You may send all or parts of a workspace using email.

Send Tables, Sets, and Workspaces

You can send Alpha Anywhere tables, sets, or entire workspaces via email.

Sets vs Tables

Alpha Anywhere is a relational workspace management system. A relational system allows you establish links between data in several tables.

Sorting Records

There are two ways to specify the records to print and the order in which they print. You can either save the criteria in the label layout, or prompt the user at print time. These options are not mutually exclusive, so you can choose to save order and selection criteria, and then make changes to the criteria just before the Labels print. To save order and selection criteria in a Label layout:

Testing if a New Record Was Created

If you want conditionally run a script only when a new record was created, you can place this code in the CanSaveRecord event of the form.

Updating Selected Records in a Table

When viewing a form or browse, you may update selected records in the current table using an Update Operation or when viewing a table through a form or browse.

Using a Lookup to Set the Current Record

This topic describes how to use a table lookup to set the current record. The example is based on the Customer table of the AlphaSports sample database. The following form shows the Firstname, Lastname, Company, and Phone fields from the Customer table. In addition, there is a drop down combo box with the label "Lookup". The lookup field displays unique field values from the Phone field. When you select a phone number if the lookup field, the other controls on the form update automatically to show fields from the same record.

Using a Query to Find a Record

The following script shows how a query works. First, we open a table and set the query dot variable parameters. In this case the default record order is fine. We only filter for records where the field Bill_State_Region equals "MA". Finally, we create the query list.

Using Addin Variables to Create a Multi-Database Application

Our agency is responsible for administering many programs for the needy population in our county. For over 10 years, we have used Alpha Software to handle the task. The system is currently written in Alpha5 version 1 and it has performed admirably! Our user interface is one where they sign into the system with a user-id and password. Once authenticated, the user is presented with a "Main Menu" application. Applications were a series of "card stacks", which are forms not associated with any table or set, only the application. From this Main Menu, a user can get to (provided they have appropriate security) whichever application they need. Application-to-application communication was fairly straightforward using an "app_run" command. We were also able to create "Global" variables that would be available to all called applications. With the release of version 2 of Alpha 5, card stacks were no longer being used, and Xbasic, as we knew it, had changed. The methodology we used in our system design could no longer be used!

Using an Index to Find a Record

The following script is provides a simple example of how to use an index to determine whether a record exists, and to act accordingly. To start, we create an index based on lastname and firstname named "LF". The Order Expression for the index is alltrim(lastname) + "," + alltrim(firstname).

Using Tables and Sets That are Not Part of a Workspace

There is actually no need to have all of the tables and sets in an application be members of the workspace. Iin fact, you could build an application where none of the tables and sets are in the workspace. If you do this, the change that you would have to make in your Xbasic would be to full qualify references to forms, reports, tables, etc.

Using the New Table/Set Genie

To open the New Table/Set Genie :

Using the Shortcut Genie

The Create Shortcut Genie creates a shortcut to load Alpha Anywhere and start a particular database. You can place the shortcut on the Start menu, in a particular group, or on the desktop. The Create Shortcut Genie lets you specify your own splash screen, title, and icon for the Alpha Anywhere program window, and also to specify special flags, such as whether the Alpha Anywhere window should be opened minimized or maximized and whether the user should be able to resize the main Alpha Anywhere window. To open the Create Shortcut Genie, select Tools > Create Shortcut.

Using the Spell Check

The Alpha Anywhere Spell Check lets you check the current record, the current selection of records, or the current field. To start the Spell Check :

Using Transactions

Many databases allow you to perform record updates within the context of a transaction. A transaction is useful when you want to make multiple updates or no updates at all. You bracket the INSERT, DELETE, or UPDATE commands with the SQL::Connection BeginTransaction(?) and CommitTransaction(?) methods. In the case when you cannot complete all the required updates, you conclude with the RollBackTransaction(?) method instead of the CommitTransaction() method. Suppose you want to copy records from the Product table to the New_Product table. Then, after you have confirmed the copy, you want delete these records from the Product table.

Working with Workspaces

Tables, sets, and workspaces are the primary structures for storing data in Alpha Anywhere. Your workspace files keep track of all of the tables, sets, toolbars, forms, and such, used for managing information. When you open an existing workspace, Alpha Anywhere displays the objects (tables, forms, etc.) that make up the workspace in the Control Panel. With Alpha Anywhere, you work with one workspace at a time.

Zip Workspace

A Zip file is a standard file format that is used to store files in a compressed form. You can use products such as WinZip? to view the contents of a zip file. If you don't have WinZip, you can download a shareware version from www.shareware.com. You may zip all or parts of a workspace into a compressed zip file.

Zip Tables, Sets, and Workspaces

You can zip tables, sets, and entire workspaces from within Alpha Anywhere.

Zoom to Record

If a form has an embedded browse, you can use the Zoom to Record command to switch to a user-selected form to display more detail on the current record in the embedded browse.