Lesson 2 - Table Properties

Top  Previous  Next

 

Lesson Tasks:

Explore and understand the Table Properties options.

 

Table Types

In the DCT Explorer, folders are available for you to add a Table, Global Data group, or Field Pool structure. You can define relationships for tables, but not for Global or Pool structures. The Add button dynamically changes based on what folder you have selected.

 

Tables

The structure represents a FILE. The Application Generator generates a FILE declaration as well as code to read and write the FILE. You can use the columns in the FILE as the parents of derived fields. See Derived From in the Column Properties dialog.

Globals

The structure represents a group of global data declarations. The Application Generator generates a global data declaration for each field in the structure. You can use the global fields as the parents of derived fields. See Derived From in the Column Properties dialog. This option enables the Generate Last checkbox, which causes these declarations to follow declarations made for global variables defined in the .APP.

Pools

The structure represents a Field Pool. The Application Generator generates no code for this structure. You can use the fields in the pool as the parents of derived fields. See Derived From in the Column Properties dialog.

 

Table Properties

 

The Table Properties window allows the characteristics of a data table as a whole to be specified. An explanation of key options shown in the Table Properties window follows:

 

 

Label

Type a data table name, as you wish to refer to it in your code. This serves as the label for the Clarion FILE structure. Specify a valid Clarion label--Clarion will automatically truncate the name if necessary. You may also specify a completely different name for the DOS file--see Full Pathname, below.

Description

Descriptions are a string of characters used to fully describe the contents of a data table. If the Table Label specified is somewhat cryptic, it is a good idea to enter a meaningful description. Information entered in the Description field is treated as a comment. The double-arrow button at the end of the description field may be used to enter a very long description of the table.

 

Prefix

A prefix is a combination of up to 3 characters that will preface the names (labels) of all of the fields defined within this data table. Prefixes are used to uniquely identify fields with the same name in different tables. The prefix will default to the first 3 characters of the Table name but can be overridden.

 

 

Driver

As mentioned previously, Clarion supports a number of different data table formats. The format to be used for table being created is specified in the Table Driver field. The formats currently supported include Clarion, Btrieve, binary (specified as DOS), flat ASCII (specified as ASCII), comma-delimited ASCII (specified as BASIC), and various xBase formats.

Choose the table format that should be used from the list of available table drivers that is displayed in a combo box. A table driver must be chosen from the list. Since certain table characteristics are table driver dependent, after a driver is chosen, some options may be disabled.

Driver Options

The behavior of some of the database drivers may be customized. This customization is accomplished through the use of parameters when the driver is loaded. Online help documents the OPTIONS that may be specified for each of the table drivers.

Owner Name

Owner name is a combination of characters that can be used to restrict access to a data table. This is used to prevent someone from gaining access to table organization information. If this data table is not organized in a particularly sensitive manner or will not contain sensitive data, leave this field blank. All database drivers do not support this option.

Full Path Name

The drive, path, and actual DOS file name (if different from the File Label) for this data file should be specified here. If omitted, programs created with this dictionary will assume that the data table resides in the directory that is active when the program loads.

Create

This option is selected if the file may be created at run time.

Reclaim

This checkbox is selected if the space occupied by previously deleted records should automatically be reused when new records are added to the data file. This option is not supported for all file drivers.

Encrypt

This checkbox is selected if the data in the data file should be "scrambled" based on the Owner Name that was specified. If this option is selected, the data in the data file will be unreadable unless the Owner Name is known.

Threaded

If this file will be used in Multi-Threaded procedures, this checkbox will reserve additional memory for the record structure defined in every instance.

OEM

This option specifies that string data is converted from OEM ASCII to ANSI when read from disk and ANSI to OEM ASCII when writing to the file.

Bindable

This checkbox will specify that all variables in the Record structure are available for use in dynamic expressions at runtime.

 

After entering the appropriate information for the file, press OK to complete the Add Table window. The file just defined now appears in the Dictionary window.

When you have entered and reviewed all available options, press the OK button to save the file definition, and close the File Properties window.

 

Next: Lesson 3 - Column Properties