Contact | Privacy | Datenschutzerklärung | Impressum

The dba Library

General

The dba Library allows you to quickly build standard SQL Database Applications. It offers a TABLE view and a FORM view for each relation (or table) belonging to a database.

Using the TABLE view, Users can browse the contents of an SQL Table, scrolling backwards or forwards while displaying a pre-determined number of records per page.

The FORM view displays the contents of individual records, either in an editable or non-editable format. While in edit mode new records can be inserted, or old records modified or deleted. Applications can be programmed to respond in a flexible manner to User input errors, and password protection of individual records is also supported.

To create a new dba Application you only have to specify:

  • the layout of fields to be displayed in TABLE view
  • the layout of fields to be displayed in FORM view
  • functions to test or validate User input

The dba Library provides all the tools you need to rapidly develop a wide variety of Database Applications.

To use the dba Library, insert the following statement at the top of your page:

< include name="dba.hei" />

Features

Of the TABLE view

  • User definable layout of columns to be displayed
         (You can display some or all of the fields in a Table)
  • Scrolling functions: first, next, previous, last
  • Records are shown in order based on a specific key
  • A key can consist of several fields
  • For each field, ascending or descending order can be selected
  • All SQL queries use an index based on the key fields, so relations of any size can be shown

Of the FORM view

  • User definable layout
  • A record can be shown in edit mode or disp mode
  • A separate layout can be defined for each mode, if required.

For field formatting:

All normally recognized HTML fields are supported:

  • String fields
  • Text areas
  • Checkboxes
  • Scrolling menus

In addition, heitml supports active content field-types such as:

  • Email fields (displayed as mailto: links)
  • Link fields (displayed as hot-links)

Structure of a dba Application

A dba application can be contained within a single heitml-page or it can be split up among several pages. It is possible for several dba applications to closely cooperate. It is even possible to have multiple dba applications on a page (although some restrictions apply in Version 1.0).

A dba application page is divided into four parts

  • The Declaration part,
  • the Database Action part,
  • the TABLE view,
  • and the FORM view.

The Declaration part declares parameters that are required in order for the application to run.

The Database Action part contains test routines that produce error messages if the User enters invalid data into a field.

The TABLE view and FORM view parts contain the layout definitions. This is where you define what a User sees when browsing through the database (TABLE view), or editing or displaying data from a specific record (FORM view).

Control Structure

The dba components are action driven. That means the heitml page receives an action as a parameter and the dba components within the page do something only if an action has been requested that falls within their function. This is what makes it possible to have a complete browse-edit application within a single heitml page.

For example, actions are first, last, next, and prev for the TABLE view to show the first, last, next or previous page of records.

Actions for the FORM view are (for example) show (as form) or empty (to display an empty form into which a new record can be added).

The dba Library contains Tags to create links (or buttons within a form) to call a dba page with a certain action. For example:

<dbaAempty> Show empty Form </dbaAempty>

creates a link that will call the page with action empty in order to display an empty form.

The Declaration Part

<dbapp gb, rel="register", src="guest.hei">

This declares a new application named gb, that works on the database relation register, using the heitml-page guest.hei.

The Application Name is merely the name of a local variable which identifies the application within the page. This variable must be passed to all dba Tags within the page. Under certain circumstances several dba applications may co-exist in the same page. In such cases these applications are differentiated by their respective Application Names.

<dbakeyfield gb "Email">

defines a key field for the relation. Several key fields can be given if necessary; however, the key must be unique in order for the application to work properly.

The Database Action Part

Example:

<dbaupdate gb r o;
  if !Contains (r.Email,"@");
   dbaerrmsg
    > Email must contain @  <
   /dbaerrmsg;
  /if;
/dbaupdate>

The <dbaupdate> Tag performs any necessary insert or update actions. Inside of the <dbaupdate> environment you can specify conditions in order to test or validate whatever data has been entered. If the data is determined to be in error, a message can be displayed and the User given a chance to correct it. The <dbaerrmsg> Tag also makes sure that the record is not stored in the database until all validation tests have been passed.

<dbadelete gb r; /dbadelete>

This environment Tag performs a delete, if requested.

The Table View

Example:

<dbaTable gb>
 <table border="border">
  <dbaTableEntry gb r>
   <tr >
    <td > <dbamailto gb "Email"> </td>
    <td > <dbafi gb "FirstName">
         <dbafi gb "LastName"> </td>
    <td > <dbafi gb "City">
         <dbafi gb "State"> </td>
    <td > <dbaAshow gb> Edit  </dbaAshow>
         <dbaAdisplay gb> Display </dbaAdisplay>
    </td>
   </tr>
  </dbaTableEntry>
 </table>
 <br >
 <dbaAfirst gb> First Page    </dbaAfirst>
 <dbaAprev gb>  Previous Page </dbaAprev >
 <dbaAnext gb>  Next Page     </dbaAnext >
 <dbaAlast gb>  Last Page     </dbaAlast > <p>
</dbaTable>

Inside the <dbaTable> environment the TABLE layout is defined. Most prominent is the <dbaTableEntry> environment. Its body is repeated for every record to be shown. Inside are Tags to display the individual fields within records (e.g. <dbamailto>, and <dbafi>) and Tags to define buttons and links (<dbaAshow>, <dbaAdisplay>, <dbaAnext>, <dbaAprev>, <dbaAfirst>, <dbaALast>).

Actions of the table view are

  • first - show the first page
  • last - show the last page
  • next - show the next page
  • prev - show the previous page

The Form View

Example:

<dbaform gb r  keyact="upd">
 Please enter your information <br >
  <table cellpadding="0" cellspacing="0">
   <tr >
    <th > Email:  </th>
    <td > <dbafi gb "Email" 30> </td> </tr>
   <tr >
    <th > First Name: </th>
    <td > <dbafi gb "FirstName" 15>
         &nbsp;<b> Last Name:</b>
         <dbafi gb "LastName" 30> </td> </tr>
   <tr >
    <th > Address:   </th>
    <td > <dbafi gb "Address1" 45 60> </td> </tr>
   <tr >
    <th >     </th>
    <td > <dbafi gb "Address2" 45 60> </td> </tr>
   <tr >
    <th > City:  </th>
    <td > <dbafi gb "City" 30>
         <b> State: </b>
         <dbafi gb "State" 2> </td> </tr>
  </table>
 <dbafipassword gb>
 <dbaAsubmit gb> Send </dbaAsubmit>
</dbaform>

The FORM view is made up by the <dbaform> environment. Inside you can define the layout of a form using heitml and the dba field formatting Tags.

The FORM view will show up either as an HTML FORM with writable record fields, or simply as ordinary HTML text. The first case is used to insert, delete, and update records, and the latter to display existing records.

Based on the action selected the form view will do one of the following:

  • display the record as ordinary HTML
  • show the record in an HTML FORM, or show nothing if the desired record does not exist.
  • showemp works the same as show, but shows an empty form if the record does not exist.
  • empty shows an empty form
  • redisplay the data just entered. Redisplay is used if an error occurred and the User should be prompted to correct his/her input

The third parameter of <dbaform> is an output parameter that is assigned to the record to be displayed.


This page was dynamically generated by the web application development tool RADpage of H.E.I. H.E.I. provides support, tools, and services like Webdesign in Mannheimm, the HTML/CSS 3D WebGL Animation Library taccgl, 3D Webdesign, and 3D Product Configurator (3D Produkt Konfigurator in German).

Selected blog articles : 3D Objects on HTML pages, CSS Transition Visibility, and CSS Transition Display.


© 1996-2022 H.E.I. All Rights Reserved.



Homepage
Intro/Features
Component Guide
Programming
  Language Guide
  Language Ref.
  Component Ref.
  Class Library
  User Components
  Tutorial
  New Features
  heitml 1
    dba Tutorial
    dbq Tutorial
    dbs Tutorial
    The heitml Libraries
      Standard Layout
      Session Libraries
      The dba Library
        dba Special Topics
        dba Tags
      Query Forms
      Scroller
      Outline Library 1
      Email Form Library
      Counter Library
      HTML Extensions 1
      Date/Time Library 1
      Math Library 1
      String Library
    Demonstration
User Guide
Services
Privacy
Datenschutz
 
Contact / Impressum