Documentation/BASIC Guide/Database Forms

From Apache OpenOffice Wiki
< Documentation‎ | BASIC Guide
Revision as of 14:06, 28 September 2007 by Fpe (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Database Forms

Apache OpenOffice forms can be directly linked to a database. The forms created in this way provide all the functions of a full database front end without requiring independent programming work.

The user has the option of paging through and searching the selected tables and queries, as well as changing data records and inserting new data records. Apache OpenOffice automatically ensures that the relevant data is retrieved from the database, and that any changes made are written back to the database.

A database form basically corresponds to a standard Apache OpenOffice form. In addition to the standard properties, the following database-specific properties must also be set in the form:

DataSourceName (String)
name of data source (refer to Database Access ; the data source must be globally created in Apache OpenOffice).
Command (String)
name of table, query, or the SQL select command to which a link is to be made.
CommandType (Const)
specifies whether the Command is a table, a query or a SQL command (value from com.sun.star.sdb.CommandType enumeration).

The com.sun.star.sdb.CommandType enumeration covers the following values:

TABLE
Table
QUERY
Query
COMMAND
SQL command

The database fields are assigned to the individual control elements through this property:

DataField (String)
name of linked database field.

Tables

Another control element is provided for work with databases: the table control element. This represents the content of a complete database table or query. In the simplest scenario, a table control element is linked to a database using the autopilot form, which links all columns with the relevant database fields in accordance with the user specifications. Because the associated API is relatively complex, we shall not provide a complete description of the API at this point.


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools