Inserting a database field

You can insert a database field into a document (see Inserting a field).

  1. Once you have selected Database, click on Next to go to the next page.

  2. In the Database Name box, type in the database name and its directory (along with the full path if it comes under a different directory from your current document). Alternatively click on the button to the right of the Database Name box to display the "Open" dialog. Here you can search for and select the required database.

  3. Click on Open in the "Open" dialog to insert the database name and path into the Database Name box.

  4. In the Data Source box, click on the arrow to the right of the box to display the tables contained in the database. Select one of these.

  5. In the Data Field box, click on the arrow at the right to display the fields in the selected database table. Select the field whose contents you want to see in your document.

  6. The Enable Browsing box is checked by default, thereby enabling you to browse through all the records from the field that has been inserted into your document. If you don't want to browse through all the records and just want the first record to be displayed, click on it to remove the check.

  7. On the next page you can set a Control Type for the database field (see Control types).

Example

To create a database field in a Write or Spreadsheet document, using the surname field from an Employees table in a database called Company.adb, do the following:

  1. Select the Field command from the Insert menu

  2. Type "Surname" in the Field Name box

  3. Click on Database in the Field Type box

  4. Click on Next and then click on the button to the right of the Database Name box. The "Open" dialog is displayed. Find and select Company.adb. Click on Open. The database name and path is inserted into the Database Name box.

  5. Click on the arrow in the Data Source box and select Employee.

  6. Click on the arrow in the Data Field box and select Lastname.

  7. Leave the Enable Browsing box checked.

  8. At this point click on Finish (ignore for now the remaining pages of the "Insert Field" Wizard).

  9. The field will appear in your Write or Spreadsheet document, displaying the first record under the Lastname field from the table. Use the arrows at the bottom left of the window to scroll through all the records.