Working with the Visual Database Designer

The Visual Database Designer is an application within Paradox that lets you visually design a database by creating, editing, and linking tables. You can do most of the basic planning for a database within the Visual Database Designer. You can also establish referential integrity between tables, view the fields of tables, and create, print, and save a layout of the database design.

In this section, you'll learn about

  opening the Visual Database Designer
  
  creating tables in the Visual Database Designer
  
  modifying tables in the Visual Database Designer
  
  linking tables by using the Visual Database Designer
  
  viewing table and link information by using the Visual Database Designer
  
  refreshing the Visual Database Designer workspace
  
  previewing a database diagram
  
  printing a database diagram
  
Opening the Visual Database Designer

The visual layout of a database is displayed when you open it in the Visual Database Designer. The Visual Database Designer looks similar to the Data Model Designer, but their purposes are very different. The Data Model Designer lets you link tables for the purposes of creating data models used with forms and reports. The relationships that you create between tables using the Visual Database Designer are actually saved in the table structure. For more information about the Data Model Designer, see "Creating data models."

To open the Visual Database Designer

  Click Tools  Visual Database Designer.
  
Creating tables in the Visual Database Designer

The Visual Database Designer helps you create tables that are in the database and lets you see how the tables within the database relate to one another.

Each table in the Visual Database Designer contains icons that represent the following information:

   indicates the field is set as a key field. If more than one field has a blue key, that table has a composite index.
  
   identifies a field
  
   indicates a composite key
  
   indicates that an index has been established on the field
  
Once you are finished creating the database diagram layout, you can save the layout for the next time you open the Visual Database Designer.

To create a table by using the Visual Database Designer

1	Click Tools  Visual Database Designer.

2	Click Insert  New table.

3	In the Table name dialog box, type a table name in the Name box.

4	Click OK.

5	In the Create table dialog box, define the fields and properties for the table.

6	Click Create.

Notes

  For information about creating a table, see "Creating and modifying tables."
  
  For more information about defining table fields and properties, see "Creating, defining, and modifying table fields."
  
To save a database diagram

  Click File  Save.
  
Note

  The layout of a database design is saved in a file called DBL$file.$$$.
  
Modifying tables in the Visual Database Designer

To create a database diagram, you need to add tables. Once you add tables to the Visual Database Designer workspace, you can modify the table structure and manipulate the way the tables look. You can move and resize tables. You can also collapse a table to clear the workspace. Collapsing a table lets you view the name and fields found in the table or the table name only. If a table is collapsed, you can expand it.

To add a table to a database diagram

1	Click Edit  Add table.

2	In the Add table dialog box, choose a table from the list.

3	Click Add.

4	Click Close.

Tip

  You cannot change the working directory from the Add table dialog box. If you need to change the working directory, click File  Working directory before you add a table to the Visual Database Designer.
  
To modify a table by using the Visual Database Designer

1	Click a table to select it.

2	Click Edit  Restructure.

3	Modify any fields or properties of the table.

4	Click Save.

Note

  For more information about modifying table fields, see Creating, defining, and modifying table fields.
  
To move a table in the database diagram

  Drag the table title bar to a new location in the workspace.
  
To resize a table

1	Click a table to select it.

2	Point to a table frame until the pointer changes to a double headed arrow.

3	Drag the table frame to resize the table.

Dragging inward reduces the size; dragging outward increases the size.

Tip

  You can resize a table to its default size by clicking View  Auto table resize.
  
To collapse a table

1	Click a table to select it.

2	On the title bar of the table, click the Up arrow button.

Tip

  You can collapse the table to view only the table name by double-clicking the Up arrow button on the title bar.
  
To expand a table

1	Click a table to select it.

2	On the Title bar of the table, click the Down arrow button.

Tip

  You can fully expand the table to view the table name, table fields, and any indexes assigned to the table by double-clicking the Down arrow button.
  
Linking tables by using the Visual Database Designer

You can use the Visual Database Designer to establish referential integrity relationships between tables by creating links. Any relationships that you establish in the Visual Database Designer are automatically saved in each table's structure.

When linking a child table to a parent table, the fields you are linking must match in type and size. In addition, the Parent table's field must be the key field. For more information about keys, see "Defining and removing keys."

You can delete a referential integrity relationship by deleting its link. You can also display the name of the link in the diagram. For more information about referential integrity, see "Defining referential integrity."

To create a link using the Visual Database Designer

1	Choose the field of the child table you want to link.

2	Drag the field from the child table to the field you want to link to in the parent table.

3	Type a name for the referential integrity link in the Link name text box.

4	Choose the child table you want to link from the Child table list box.

5	Choose the child table field you want to link from the Child table field list box.

6	Choose the parent table you want to link to from the Parent table list box.

7	In the Update rule area, enable one of the following options:

  Cascade - specifies that any change you make to the value in the key of the parent table is automatically made in the child table
  
  Prohibit - specifies that you cannot change a value in the key of the parent table if there are records that match the value in the child table
  
Tip

  You can also create a link by clicking Edit  Referential integrity link properties and clicking New.
  
To display a referential integrity link in the Visual Database Designer

  Click View  Show referential integrity link name.
  
To delete a link in the Visual Database Designer

1	Click a link.

2	Click Edit  Referential integrity link properties.

3	Click Unlink.

Viewing table and link information by using the Visual Database Designer

The Visual Database Designer not only shows you the relationships between tables, but also lets you view specific table structure and link properties, such as table lookups, keyed fields, and secondary indexes.

To view table structure information in the Visual Database Designer

1	Click Tools  Utilities  Info structure.

2	Choose the drive and folder where the table is stored.

3	Double-click the filename.

To view link properties in the Visual Database Designer

1	Click a link.

2	Click Edit  Referential integrity link properties.

Refreshing the Visual Database Designer workspace

If you've made changes to the database design in the Visual Database Designer (for example, you've made changes to a referential integrity relationship) you can refresh the workspace to update the changes that you made.

To refresh the Visual Database Designer workspace

  Click View  Refresh diagram.
  
Previewing a database diagram

Before you print a database diagram layout, you have the option of previewing how it will look.

To preview a database diagram

1	Click File  Print preview.

If the diagram has multiple pages, click the Next page or Previous page button on the toolbar.

2	Click File  Close.

You can also	

View a specific page if the diagram has multiple pages.	Click View  Go to. Type a value in the Page number box.

Modify the page setup.	Click the Page setup button on the toolbar.

Print the diagram.	Click File  Print.

Printing a database diagram

Once you design a database diagram, you can print it by using the default printer settings or by creating your own printer settings. Printer settings can be changed at any time and you can delete the settings you created. In addition, database diagrams can be printed in color and you can print text as a graphic.

To print a database diagram

1	Click File  Print.

2	In the Destination area, choose a printer from the Name list box.

If you want to print your diagram to a file, enable the Print to file check box.

3	In the Print range area, enable the Full file option.

If you are printing page numbers, a value in the Number on first page box.

4	In the Copies area, type a value in the Number of copies box.

If you are printing multiple copies, you can collate the pages by enabling the Collate check box.

5	Choose printer settings from the Settings list box.

6	Click Print.

You can also	

Preview a print job.	Click Preview.

Print a range of pages.	In the Print range area, enable the Pages option. Type a page range in the Pages box.

Print pages in reverse order.	In the Copies area, enable the Print in reverse order check box.

Check print history and status.	In the Print dialog box, click the Main tab and click Status.

Change your printer properties.	In the Print dialog box, click the Main tab. Click Properties.

To create new printer settings

1	Click File  Print.

2	Click Edit settings.

3	Type a name for the new settings in the Name for current settings list box.

4	In the Named settings dialog box, choose the new settings from the Settings to save list.

5	Click Add.

To change printer settings

1	Click File  Print.

2	Click Edit settings.

3	In the Named settings dialog box, choose a setting from the Name for current settings list box.

4	Click Replace.

You can also	

Replace printer settings with system default settings.	Enable the Use printer properties from system default check box. Enable the Save current printer properties with setting option.

Retrieve properties from the printer each time the setting is retrieved.	Enable the Use printer properties from system default check box. Enable the Retrieve properties from printer each time the setting is retrieved option.

To remove printer settings

1	Click File  Print.

2	Click Edit settings.

3	In the Named settings dialog box, choose a setting from the Settings to save list.

4	Click Delete.

Note

  You can't delete default printer settings.
  



