Skip to content

Opening a Table

While Database Builder can be used to maintain tables, we recommend that you use the Studio to maintain tables during development.

Database Builder provides several different ways for you to open a table. You can quickly select a table from the file list, select multiple tables to be opened simultaneously, and open a table that is not registered on the current workspace’s file list.

Using the File List

To open a single table that is registered in the current workspace's file list, click the Filelist combo form in the toolbar. Now, select the table you wish to open.

Using the Recent Tables List

Database Builder maintains a list of recently opened tables for each workspace. To open a recent table from this list, choose Recent Tables from the File menu. Now, select the table you wish to open.

Opening Multiple Tables

To open one or more tables from the file list, choose Open… from the File menu or click the Open Tables button on the toolbar. This will activate the Select Tables to Open dialog, which allows you to select and open tables in various ways.

Click the checkbox of each table in the list that you wish to open. The list may be sorted in any order by clicking the appropriate column title. You may also use some of the table selection buttons (described below) for marking tables to be opened.

Button Functions

The following describes the function of each of the buttons to the right of the list of tables:

  • Open: Clicking this button or pressing F2 opens the selected tables in the non-exclusive (shareable) mode. In this mode, you can view the column and index structures but cannot change them. Once the table is open, you can switch between non-exclusive and exclusive mode by simply clicking a button.

  • Open Exclusive: Clicking this button opens the selected tables in exclusive mode. In this mode, you can edit the column and index structures. However, while the table is open in exclusive mode, no other application or user can access that table. If you try to open a table in exclusive mode that is already open in another application, then the non-exclusive (shareable) mode will be used instead. Once you have the table open, you can switch between non-exclusive and exclusive mode by simply clicking a button. Switching to exclusive mode will continue to be affected by whether another program has opened it.

  • Cancel: Clicking this button closes this panel and opens no tables, regardless of whether any are selected.

  • Select All: Clicking this button selects every table in the list. This is often used as a preliminary to further selection or de-selection of tables.

  • Invert Selection: Clicking this button de-selects all tables that were selected and selects all tables that were not selected.

  • Select None: Clicking this button clears any selection of tables that may currently exist.

  • Tag Bad Entries: Clicking this button selects all tables that are registered in the file list for which DataFlex cannot find the physical files. This can occur if the files have been deleted or moved. All other selected tables, if any, are de-selected.

  • Tag Child Tables: Clicking this button selects all child tables that relate to the table whose name the cursor is on. All other selected tables, if any, are de-selected.

  • Tag Parent Tables: Clicking this button selects all parent tables to which the table whose name the cursor is on relates. All other selected tables, if any, are de-selected.

  • Create ASCII File: Clicking this button allows you to output Filelist information to an ASCII file (table number, file name, display name, and DataFlex name). When you press this button, there is a further dialog for specifying options such as line-delimited or comma-delimited format and check-boxes for selecting the information to be output.

Opening Files Recursively

Activate the Select Files to Open Recursively dialog, which enables you to select and open tables in various ways. Click the checkbox of each table in the list that you wish to open recursively.

Refer to Opening Multiple Tables for more information.

Opening a Table Not Registered in the File List

To open a table that is not registered in the file list of the current workspace, select Open as… from the File menu or click the Open As… button on the toolbar. This activates the Open As dialog, and you are prompted to enter the following information:

Table Number

Enter a table number that is not being used by any other table. The table number you assign will not be added to the file list when you exit but will appear in the file list while you have the table open. You are prompted with the lowest unused table number. The table number you choose must be within the supported range.

Table Name

Enter the drive, path, and file name of the table you are opening.

Example

Table Name = C:\Projects\Order\Data\Codemast

In this example, we are attempting to open the Codemast table in the C:\Projects\Order\Data folder on drive C:. The prompt button in the File Name form will allow you to browse your folders to select a table to be opened. The selected table’s drive, path, and file name will be entered.

Note

SQL database drivers may require that you enter additional information in the File Name form.

Once you have entered the above information, click on the OK button to open the table in non-exclusive mode, or click the Open Exclusive button to open the table in exclusive mode.

Table Opening Modes

Database Builder supports opening tables in two different modes:

  • Non-Exclusive: You will not be able to change the table structure or indexes. Other programs and users can read and write to the table while you have it open in this mode.

  • Exclusive: You will be able to change the table structure and indexes. While you have the table definition open in this mode, no other program or user will be able to access the table.

When you open a table in Database Builder, it will use the non-exclusive mode unless you explicitly specify that it should be opened exclusive. The reason for this is to allow the table to be shared by other applications and users while you are inspecting it. You can do both of these things in non-exclusive mode without first having to exit any other applications that also have the table open.

Editing the structure or indexes of a table requires that it is opened in exclusive mode. Before opening a table in exclusive mode, you must ensure that no other application has the table opened at the same time. Once the table is opened in exclusive mode, any other DataFlex program that tries to open it will receive a "Can’t Open .DAT file" error.

It is recommended that unless you are editing the structure of a table or its index, the table should remain in default (non-exclusive) mode. This is especially important in a team development environment.

Switching Open Modes

Once a table has been opened, you can toggle its mode. There is a special button on the table-definition dialog for this purpose. Database Builder will always prompt you to save any pending changes before it switches the mode of the table. If you try to switch a table to exclusive mode that is currently open in some other application, you will receive a warning, and the open will revert to the non-exclusive mode.

Note

Tables will be opened according to the Default Open Mode setting in the Database Builder properties.