21.08.2013 Views

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Control Element Forms<br />

selectItem (Item, SelectMode)<br />

activates or deactivates the highlighting for the element specified in the string Item depending on the<br />

SelectMode variable<br />

makeVisible (Pos)<br />

scrolls through the list field so that the entry specified by Pos is visible<br />

Database Forms<br />

<strong>OpenOffice</strong>.<strong>org</strong> forms can be directly linked to a database. The forms created in this way provide all the functions<br />

of a full database front end without requiring independent programming work.<br />

You can page through and search in the selected tables and queries, as well as change data records and insert new<br />

data records. <strong>OpenOffice</strong>.<strong>org</strong> automatically ensures that the relevant data is retrieved from the database, and that<br />

any changes made are written back to the database.<br />

A database form corresponds to a standard <strong>OpenOffice</strong>.<strong>org</strong> form. In addition to the standard properties, the<br />

following database-specific properties must also be set in the form:<br />

DataSourceName (String)<br />

name of data source (refer to Database Access; the data source must be globally created in <strong>OpenOffice</strong>.<strong>org</strong>)<br />

Command (String)<br />

name of table, query, or the SQL select command to which a link is to be made<br />

CommandType (Const)<br />

specifies whether the Command is a table, a query or a SQL command (value from<br />

com.sun.star.sdb.CommandType enumeration)<br />

The com.sun.star.sdb.CommandType enumeration covers the following values:<br />

TABLE<br />

QUERY<br />

Table<br />

COMMAND<br />

Query<br />

SQL command<br />

The database fields are assigned to the individual control elements through this property:<br />

DataField (String)<br />

name of linked database field<br />

Tables<br />

Another control element is provided for work with databases, the table control element. This represents the<br />

content of a complete database table or query. In the simplest scenario, a table control element is linked to a<br />

database using the autopilot form, which links all columns with the relevant database fields in accordance with the<br />

user specifications.<br />

176 <strong>OpenOffice</strong>.<strong>org</strong> 3.2 <strong>BASIC</strong> <strong>Guide</strong> · March 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!