Difference between revisions of "QA/Database"
m (→Usage registered database in Calc and Writer) |
m (→import data to base) |
||
(28 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
* Embedded database | * Embedded database | ||
− | *# Create a new database, use HSQL database as default setting(Pure Java DB) | + | *# Create a new database, use HSQL database as default setting (Pure Java DB) |
*# Open an existing database file, open created new database file and connect to database file. | *# Open an existing database file, open created new database file and connect to database file. | ||
* External business database | * External business database | ||
*# Connect to an existing database | *# Connect to an existing database | ||
− | {| class=" | + | {| class="wikitable" "style:margin-left: 10px;" |
+ | ! Support Type !! comments | ||
|- | |- | ||
− | | | + | | JDBC || Database url and driver class |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Oracle JDBC || need provide some commonly used db(provide JDBC)<br/> Oracle JDBC, driver class is given—oracle.jdbc.driver.OracleDriver |
− | + | ||
− | + | ||
− | Oracle JDBC | + | |
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | need provide some commonly used db(provide JDBC) | + | |
− | + | ||
|- | |- | ||
− | | | + | | ODBC || ODBC data source(dBase files,excel files, MS Access database) |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | MySQL || Connect use JDBC or ODBC |
− | + | ||
− | + | ||
− | | | + | |
− | ODBC | + | |
− | + | ||
|- | |- | ||
− | | | + | | Spreadsheet || Open OpenOffice Calc spreadsheet or MS Excel in read-only mode. |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | LDAP address book |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | SeaMonkey address book |
− | + | ||
− | + | ||
− | SeaMonkey address book | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Microsoft Outlook address book || Import an address book in read-only mode |
− | + | ||
− | + | ||
− | | | + | |
− | Import | + | |
− | + | ||
|- | |- | ||
− | | | + | | Microsoft Windows address book |
− | Microsoft | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Thunderbird address book |
− | + | |- | |
− | + | | Text || Import a database in text format. Open txt, csv, custom type in read-only mode | |
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Microsoft Access<br/>Microsoft Access 2007|| Access file |
− | + | |- | |
− | + | | dBASE || Dbase file | |
− | | | + | |- |
− | ADO (Microsoft ActiveX Data Objects) database. | + | | ADO || ADO (Microsoft ActiveX Data Objects) database. |
− | + | |- | |
+ | | Adabas D || | ||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
Line 130: | Line 64: | ||
# double click created table to input data | # double click created table to input data | ||
# Check data from design view | # Check data from design view | ||
− | # Create queries in SQL view(Grammar check when saving,Logical check on execution) | + | # Create queries in SQL view (Grammar check when saving,Logical check on execution) |
− | # create form from wizard(organize data with controller) | + | # create form from wizard (organize data with controller) |
# create report to writer | # create report to writer | ||
'''Scenario 2: Connect to an existing database via JDBC''' | '''Scenario 2: Connect to an existing database via JDBC''' | ||
− | # install driver(ensure step 4 can pass) | + | # install driver (ensure step 4 can pass) |
− | # Connection URL:mysql://127.0.0.1:3306/mysqldb, | + | # Connection URL: mysql://127.0.0.1:3306/mysqldb, |
# Driver Class: <nowiki>com.mysql.jd</nowiki>bc.Driver | # Driver Class: <nowiki>com.mysql.jd</nowiki>bc.Driver | ||
# click Test Class button, check driver can load correctly. | # click Test Class button, check driver can load correctly. | ||
# Input User name, then Test Connection | # Input User name, then Test Connection | ||
− | # check load database, table | + | # check load database, table …from mysql db. |
# Edit exist table: add column, delete column, but can't edit data record. | # Edit exist table: add column, delete column, but can't edit data record. | ||
− | # Create new table on | + | # Create new table on existing mysql database (load all database from connected db), field and data record all can be edited. |
# Create query, form, report base on exist table and new created table. | # Create query, form, report base on exist table and new created table. | ||
'''Scenario 3: Connect to an existing database via ODBC''' | '''Scenario 3: Connect to an existing database via ODBC''' | ||
− | # install | + | # install ODBC driver |
− | connect to db info( | + | # connect to db info (ensure name in step 2 can be browsed) |
# connect to exist database via ODBC | # connect to exist database via ODBC | ||
− | select name of | + | # select name of ODBC data source on system |
# other operation like Scenario2 7)8)9) | # other operation like Scenario2 7)8)9) | ||
Line 163: | Line 97: | ||
(All changes in a spreadsheet must be made in the spreadsheet itself, using Calc. After modifying the spreadsheet and saving it, you will see the changes in the database. If you create and save an additional sheet in your spreadsheet, the database will have a new table the next time you access it.) | (All changes in a spreadsheet must be made in the spreadsheet itself, using Calc. After modifying the spreadsheet and saving it, you will see the changes in the database. If you create and save an additional sheet in your spreadsheet, the database will have a new table the next time you access it.) | ||
− | '''Scenario 5 :Connect to an existing Text''' | + | '''Scenario 5: Connect to an existing Text''' |
* '''open text''' | * '''open text''' | ||
Line 169: | Line 103: | ||
*# one text one table, can't edit table. | *# one text one table, can't edit table. | ||
− | * '''open csv(address book file)''' | + | * '''open csv (address book file)''' |
*# use spreadsheet to save as to a text csv file. | *# use spreadsheet to save as to a text csv file. | ||
*# Select folder where csv in. (one csv one table, if more csv in this folder, then will get all csv more tables) | *# Select folder where csv in. (one csv one table, if more csv in this folder, then will get all csv more tables) | ||
Line 175: | Line 109: | ||
* '''open custom type file''' | * '''open custom type file''' | ||
− | # create a custom type file with definition separator(Field separator), filed separator have : , ; tab space | + | # create a custom type file with definition separator (Field separator), filed separator have : , ; tab space |
Line 181: | Line 115: | ||
# browse Access accdb file | # browse Access accdb file | ||
− | # Operation like other db(can't edit data record) | + | # Operation like other db (can't edit data record) |
− | '''Scenario 7: Connect to an existing address book(Microsoft Outlook)''' | + | '''Scenario 7: Connect to an existing address book (Microsoft Outlook)''' |
auto get windows address book, but how to check address book file need deeper investigate. If have address book file also can be opened by '''Scenario 5 ''' | auto get windows address book, but how to check address book file need deeper investigate. If have address book file also can be opened by '''Scenario 5 ''' | ||
Line 189: | Line 123: | ||
'''Scenario 8: Register a database and Use it.''' | '''Scenario 8: Register a database and Use it.''' | ||
− | # Register database automatically(The last step in Create or Connect to existing database) | + | # Register database automatically (The last step in Create or Connect to existing database) |
− | # Register database manually,File | + | # Register database manually, {{menu|File|Wizards|Address data source}} |
− | # check registered database (Tools | + | # check registered database ({{menu|Tools|Options|OpenOffice Base|DataBases}} list all registered databases. User also can remove registered databases) |
# new Calc or Writer document | # new Calc or Writer document | ||
− | # View | + | # ({{menu|View|Data Sources}} or {{button|F4}} to pop up registered data source. |
− | # Select all data then click “data to | + | # Select all data then click “data to text” button, or drag&drop table to sheet. Data from database will copy to sheet or writer. |
=Database design entry= | =Database design entry= | ||
Line 225: | Line 159: | ||
* Must have Primary Key | * Must have Primary Key | ||
* Provide shortcut of Field Type via keyboard | * Provide shortcut of Field Type via keyboard | ||
− | * Provide Index design in Tools | + | * Provide Index design in {{menu|Tools|Index Design}} |
===Use Wizard to create table=== | ===Use Wizard to create table=== | ||
Line 259: | Line 193: | ||
− | Tools | + | {{menu|Tools|Relationships}} to pop up Relationship Design Window |
[[File:Relation.PNG]] | [[File:Relation.PNG]] | ||
Line 265: | Line 199: | ||
− | Drag and Drop or Insert | + | Drag and Drop or {{menu|Insert|New Relation…}} |
[[File:Newrelation1.PNG]] | [[File:Newrelation1.PNG]] | ||
Line 318: | Line 252: | ||
Specify if you want to use a subform and enter the subform's properties. A subform is a form that is inserted in another form. | Specify if you want to use a subform and enter the subform's properties. A subform is a form that is inserted in another form. | ||
− | * Add subform fields(Will use in Form->Subform based on existing relation. | + | * Add subform fields (Will use in Form->Subform, based on existing relation. Just choose one table in one-many table relation.) |
* Get joined fields | * Get joined fields | ||
* Arrange Controls | * Arrange Controls | ||
Line 334: | Line 268: | ||
Specifies the name of the form and how to proceed. | Specifies the name of the form and how to proceed. | ||
− | + | '''Notes and problem''': | |
− | + | ||
− | + | ||
# “Data Source as table” button can combine table with form at one viewer. | # “Data Source as table” button can combine table with form at one viewer. | ||
− | # Can't modify form with form created by wizard. | + | # Can't modify form with form created by wizard. May modify form created in design view. Need deeper investigate. |
==Report== | ==Report== | ||
Line 411: | Line 343: | ||
===import data to base=== | ===import data to base=== | ||
− | * You can import text files, spreadsheet files, and address book in read-only mode only.(via | + | * You can import text files, spreadsheet files, and address book in read-only mode only. (via '''Connect to an existing database''') |
− | {| | + | {| "style:margin-left: 40px;" |
+ | |- | ||
+ | | 1. Choose {{menu|Edit|Copy}} in imported file | ||
+ | |- | ||
+ | | 2. In the Base window, click '''Tables''' in database navigate to view the tables. | ||
+ | |- | ||
+ | | 3. In the Base window, choose {{menu|Edit|Paste}}. | ||
+ | |- | ||
+ | | 4. You see the Copy Table dialog. Most databases need a primary key, so you may want to check the '''Create primary key''' box. | ||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | Notes: | + | |
+ | '''Notes''': | ||
* When you import from a text or spreadsheet file, the file must have a first row of header information. The second row of the file is the first valid data row. | * When you import from a text or spreadsheet file, the file must have a first row of header information. The second row of the file is the first valid data row. | ||
Line 432: | Line 364: | ||
==Register database and Integrate Usage== | ==Register database and Integrate Usage== | ||
− | If the database is not registered, it will not be accessible to the other | + | If the database is not registered, it will not be accessible to the other {{AOo}} components such as Writer and Calc. If the database is registered, other components can access it. |
===Register database automatically=== | ===Register database automatically=== | ||
Line 466: | Line 398: | ||
− | + | {{ Note | Many places to use registered database, such as {{menu|Writer|Field|Other|Database}} }} | |
− | + | ||
− | Many | + | |
==Others== | ==Others== | ||
− | * Tools | + | * {{menu|Tools|SQL}} for running SQL commands directly. |
− | * Tools | + | * {{menu|Tools|Extension manager}}, extension plugins. Common used extensions |
** “MySQL Connector for <nowiki>OpenOffice.org</nowiki>” , | ** “MySQL Connector for <nowiki>OpenOffice.org</nowiki>” , | ||
− | ** Oracle Report Builder for more complex report. [ | + | ** Oracle Report Builder for more complex report. [https://extensions.openoffice.org/en/project/reportdesign https://extensions.openoffice.org/en/project/reportdesign] |
− | ** Use Other database like PostgreSQL(commonly used) (Use other database via extensions)[ | + | ** Use Other database like PostgreSQL(commonly used) (Use other database via extensions) [https://wiki.openoffice.org/wiki/Base/connectivity/PostgreSQL https://wiki.openoffice.org/wiki/Base/connectivity/PostgreSQL] |
− | * Tools | + | * {{menu|Tools|Options|OpenOffice Base}} connection pool… |
− | connection pool for performance, but only some defined drivers, | + | connection pool for performance, but only some defined drivers, these drivers are not used frequently。Need deeper investigate it's benefit. |
− | * Tools | + | * {{menu|Tools|Tables Filter}} |
No effect as Help, not hide as filter definition, need deeper investigate. | No effect as Help, not hide as filter definition, need deeper investigate. | ||
Line 489: | Line 419: | ||
# All reports are based upon a single table or query. So you need first to decide what fields you want to use in the report. If you want to use fields from different tables, | # All reports are based upon a single table or query. So you need first to decide what fields you want to use in the report. If you want to use fields from different tables, | ||
# you must first combine these fields in a single query. Then you can create a report on this query. | # you must first combine these fields in a single query. Then you can create a report on this query. | ||
− | # Report: The Author in Report is the name you listed in Tools | + | # Report: The Author in Report is the name you listed in {{menu|Tools|Options|OpenOffice|User Data}}. |
# Have different context menu in CSV database client. With a CSV database the "MaxRowScan" setting allows to define how many rows should be scanned to find the correct type of a column. In the past only the first row was scanned. | # Have different context menu in CSV database client. With a CSV database the "MaxRowScan" setting allows to define how many rows should be scanned to find the correct type of a column. In the past only the first row was scanned. | ||
=Common defects from AOO mail list= | =Common defects from AOO mail list= | ||
− | + | {| class="wikitable" "style:margin-left: 10px;" | |
− | + | ! Mail title !! Main content || comments | |
− | + | ||
− | {| class=" | + | |
|- | |- | ||
− | | | + | | Crash in Calc with database || Memo field., register a database in Calc via macro |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Mailmerge from a Database query produces blank document || Mail merge from a database query |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Dragging a query into a sheet || Drag a table or query to a sheet(export)(not registered database type, separate) || Copy and paste is ok, but drag and drop have the same problem |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Postgresql-sdbc-0.7.6b installs, Postgres not an option in "Connect to existing Database" pick list || Use extensions to add other database not in pick list.<br />Extensions about database need pay attention. || Postgresql is used frequently |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | AOO database denies to open the odb file || Use three not including Filter.<br /> Open and reload || With Filter |
− | + | ||
− | + | ||
− | | | + | |
− | Use | + | |
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | RPT: report could not be reopened after 'save as' the database document || Save to another name, can't execute report normally. || Save and Reopen |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Desktop frozen on database log-in || Registered database with password protect. || Need consider data with security protect.<br />Test use Spreadsheet, MS sheet is ok, MS sheet with password can't registered. OO sheet with/without password can't registered. |
− | + | ||
− | + | ||
− | | | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Can not make form in Base only installation || Installation, If you select to install ONLY OpenOffice Base, you have to install also OpenOffice Writer || Install Base stand-alone.<br />TBD:what is OpenOffice Writer |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | | | + | |
− | Installation, If you select to install ONLY OpenOffice | + | |
− | + | ||
− | Base, you have to install also OpenOffice | + | |
− | + | ||
− | | | + | |
− | Install | + | |
− | + | ||
− | + | ||
− | + | ||
− | TBD:what is OpenOffice | + | |
− | + | ||
|} | |} | ||
=Install JDBC and ODBC driver= | =Install JDBC and ODBC driver= | ||
− | + | https://wiki.openoffice.org/wiki/Connect_MySQLandBase | |
==Install MySQL JDBC driver== | ==Install MySQL JDBC driver== | ||
− | # download JDBC driver from official website. Like download | + | # download JDBC driver from official website. Like download MySQL driver from [https://www.mysql.com/products/connector/ https://www.mysql.com/products/connector/] |
# Unzip file | # Unzip file | ||
# add driver archive (jar) | # add driver archive (jar) | ||
− | Tools | + | {{menu|Tools|Options|OpenOffice|Java}}, then click {{button|Class path}}, then click {{button|Add archive}} button, then open appear in the list of Assigned folders and Archives. |
− | + | {{button|OK}} then restart the program (restart include the Quickstarter), will take effect. (need verify db is running) | |
==Install MySQL ODBC driver== | ==Install MySQL ODBC driver== | ||
Line 626: | Line 464: | ||
− | [ | + | [https://wiki.openoffice.org/wiki/Base https://wiki.openoffice.org/wiki/Base] |
− | [ | + | [https://wiki.openoffice.org/wiki/Connecting_to_Microsoft_Access https://wiki.openoffice.org/wiki/Connecting_to_Microsoft_Access] |
− | [ | + | [https://wiki.openoffice.org/wiki/Documentation/How_Tos/Using_SQLite_With_OpenOffice.org https://wiki.openoffice.org/wiki/Documentation/How_Tos/Using_SQLite_With_OpenOffice.org] |
− | '''FAQ& TBD''' | + | '''FAQ & TBD''' |
Q: How to use address book. | Q: How to use address book. |
Latest revision as of 13:05, 28 June 2023
Database Usage Guide
A data source can be a database, spreadsheet, or text document. such as MySQL or dBase or a spreadsheet or text document holding data.
Contents
Start With Database Wizard
Database Wizard
- Embedded database
- Create a new database, use HSQL database as default setting (Pure Java DB)
- Open an existing database file, open created new database file and connect to database file.
- External business database
- Connect to an existing database
Support Type | comments |
---|---|
JDBC | Database url and driver class |
Oracle JDBC | need provide some commonly used db(provide JDBC) Oracle JDBC, driver class is given—oracle.jdbc.driver.OracleDriver |
ODBC | ODBC data source(dBase files,excel files, MS Access database) |
MySQL | Connect use JDBC or ODBC |
Spreadsheet | Open OpenOffice Calc spreadsheet or MS Excel in read-only mode. |
LDAP address book | |
SeaMonkey address book | |
Microsoft Outlook address book | Import an address book in read-only mode |
Microsoft Windows address book | |
Thunderbird address book | |
Text | Import a database in text format. Open txt, csv, custom type in read-only mode |
Microsoft Access Microsoft Access 2007 |
Access file |
dBASE | Dbase file |
ADO | ADO (Microsoft ActiveX Data Objects) database. |
Adabas D |
Common scenarios
Scenario 1: Create new embedded database
- Create a new database
- create table in design view,
- Name, type, Primary Key, format example
- double click created table to input data
- Check data from design view
- Create queries in SQL view (Grammar check when saving,Logical check on execution)
- create form from wizard (organize data with controller)
- create report to writer
Scenario 2: Connect to an existing database via JDBC
- install driver (ensure step 4 can pass)
- Connection URL: mysql://127.0.0.1:3306/mysqldb,
- Driver Class: com.mysql.jdbc.Driver
- click Test Class button, check driver can load correctly.
- Input User name, then Test Connection
- check load database, table …from mysql db.
- Edit exist table: add column, delete column, but can't edit data record.
- Create new table on existing mysql database (load all database from connected db), field and data record all can be edited.
- Create query, form, report base on exist table and new created table.
Scenario 3: Connect to an existing database via ODBC
- install ODBC driver
- connect to db info (ensure name in step 2 can be browsed)
- connect to exist database via ODBC
- select name of ODBC data source on system
- other operation like Scenario2 7)8)9)
Scenario 4: Connect to an existing Spreadsheet
- open spreadsheet with read-only mode, (one sheet one table)
- can't add table, edit table, include field definition and data record.
- Create query use Wizard(not easy to write sql to query Spreadsheet)
- create form and report base on sheet
(All changes in a spreadsheet must be made in the spreadsheet itself, using Calc. After modifying the spreadsheet and saving it, you will see the changes in the database. If you create and save an additional sheet in your spreadsheet, the database will have a new table the next time you access it.)
Scenario 5: Connect to an existing Text
- open text
- create a text like table, with field separator
- one text one table, can't edit table.
- open csv (address book file)
- use spreadsheet to save as to a text csv file.
- Select folder where csv in. (one csv one table, if more csv in this folder, then will get all csv more tables)
- Can't add table, edit table.
- open custom type file
- create a custom type file with definition separator (Field separator), filed separator have : , ; tab space
Scenario 6: Connect to an existing Microsoft Access 2007
- browse Access accdb file
- Operation like other db (can't edit data record)
Scenario 7: Connect to an existing address book (Microsoft Outlook)
auto get windows address book, but how to check address book file need deeper investigate. If have address book file also can be opened by Scenario 5
Scenario 8: Register a database and Use it.
- Register database automatically (The last step in Create or Connect to existing database)
- Register database manually, File → Wizards → Address data source
- check registered database (Tools → Options → OpenOffice Base → DataBases list all registered databases. User also can remove registered databases)
- new Calc or Writer document
- (View → Data Sources or F4 to pop up registered data source.
- Select all data then click “data to text” button, or drag&drop table to sheet. Data from database will copy to sheet or writer.
Database design entry
Entry
- Database objects: Table, Query, Form, Report
- fields
- Query: creates a new table from the existing tables based upon how you create the query
- Form: data entry into the fields of one or more tables associated with the form.(A simple form consists of the fields from a table . More complex forms can contain much more, including additional text, graphics, selection boxes, and many other elements.)
- Report: organizes the information of the fields of a query in a document according to your requirements.
- Tasks zone: List the way to create database objects.
- Description: every task in Tasks list will activate a description.
- Object Zone:
- can link to file and provide operation in context menu.
- support selecting entries by typing their name(focus object via keyboard, AOO3.4 Release notes)
- Preview (none and document). If form type, will have more operation.
- Status bar: include info about DataBase type, database name/database file path, user, IP.
Table
Create table in design view
Field Properties: Entry Required, Auto Value, Auto-increment state, Length, Format example
- Must have Primary Key
- Provide shortcut of Field Type via keyboard
- Provide Index design in Tools → Index Design
Use Wizard to create table
- Select Fields:
Select category: Business or Personal.
- Set types and format
Set types and format for selected fields.
Auto value is yes will pop up Auto-increment statement (auto value field must key) such as MySQL need input AUTO_INCREMENT to this statement box.
- Set primary key
- Create table
Create view
total same as Query Design Windows
can edit and edit in SQL view. Can't find difference with Query now. Like Database View.
Table Data view
Provide Data Filter and Data Statistics
Relation
Tools → Relationships to pop up Relationship Design Window
Drag and Drop or Insert → New Relation…
Query
Create query in design view
Field, Alias,Table,Sort,Visible
Function button: Run query, Clear query, Switch design view on/off(switch with SQL editor to check before save, after save this button is disabled)
Use wizard to create query
- Field selection
Specifies the table to create the query, and specifies which fields you wish to include in the query.
- Sorting Order
Specifies the field by which the created query is sorted. May select 4 fields at most.
- Search condition(can't save search condition, maybe defect)
Specifies the search conditions to filter the query. Specifies 3 conditions at most.
- Detail or summary
Detail-->show all results of the query. Summary-->Select to show only results of aggregate functions. Only for numeric field.
- Grouping?
- Grouping conditions?
- Aliases
Assign Aliases of field if desired.
- Overview
Form
Create Form in design view
Need macro to activate event, now still not create form in design view. Need deeper investigate.
Use Wizard to create form
- Field selection
For table and query
- Setup a subform
Specify if you want to use a subform and enter the subform's properties. A subform is a form that is inserted in another form.
- Add subform fields (Will use in Form->Subform, based on existing relation. Just choose one table in one-many table relation.)
- Get joined fields
- Arrange Controls
Layout of created form. Arrange of main form, Arrange or sub form.
- Set Data Entry
Specifies the data handling mode for the new form.
- Creates a form that is only used for entering new data. Existing data will not be displayed.
- Creates a form that can be used to display existing data and to enter new data.
- Apply Styles
Specifies the page style for the form
- Set Name
Specifies the name of the form and how to proceed.
Notes and problem:
- “Data Source as table” button can combine table with form at one viewer.
- Can't modify form with form created by wizard. May modify form created in design view. Need deeper investigate.
Report
For table and query
- Field selection
Specifies the table or query for which you are creating the report
- Labeling Fields
Label the field to the report
- Grouping
Group records in a report
- Sort options
Select the fields by which to sort the report. Fields can be sorted by up to four levels, each either ascending or descending. Grouped fields can only be sorted within each group.
- Choose layout
Layout of data, layout of header and footer
- Create report
You can create the report as a static or dynamic report
Main Function
Copy/Paste/Paste Special
- copy/paste table
- Definition and data: copy field definition and data
- Definition: just copy field definition, not the data
- As table view: copy as a table view with all definition and data
- Append data: Appends the data of the table to be copied to an existing table. These two table's field definition and format definition must the same. Copy existing table, click another target table then right click to paste.
- copy/paste special table
just table have paste special function.
Inserts the contents of the clipboard into the current file in a format that you can specify.
Copy as table view
Table <<------------------------------->>Table View
Copy and Paste special(data source table)
- Copy/paste query/form/report
Just paste with another name.
- Copy/ paste to Writer/Calc
to Calc, will auto copy the data
to writer, will design table column
Export and import data of base
export data from base
You copy a table from Base to a new Calc sheet, then you can save or export the data to any file format that Calc supports.
import data to base
- You can import text files, spreadsheet files, and address book in read-only mode only. (via Connect to an existing database)
1. Choose Edit → Copy in imported file |
2. In the Base window, click Tables in database navigate to view the tables. |
3. In the Base window, choose Edit → Paste. |
4. You see the Copy Table dialog. Most databases need a primary key, so you may want to check the Create primary key box. |
Notes:
- When you import from a text or spreadsheet file, the file must have a first row of header information. The second row of the file is the first valid data row.
- On Windows systems, you can also use drag-and-drop instead of Copy and Paste.
Register database and Integrate Usage
If the database is not registered, it will not be accessible to the other Apache OpenOffice components such as Writer and Calc. If the database is registered, other components can access it.
Register database automatically
Register database manually
File → Wizard → Address data source.(register your address book as the data source).
Can register all kinds of database not only address book, field assignment page can be ignored when register.
![]() |
Tools → Options → OpenOffice Base → DataBases list all registered data bases. User can remove registered databases in this dialog. |
Usage registered database in Calc and Writer
Click F4 or View → Data sources to pop up window to operate registered database in Calc/Writer.
Operations:
- Drag and Drop table or query in navigate tree to sheet, All definition and data will copy to Sheet/Writer page
- Data to text:Click Upper left corner to select all data in specified registered database, then click "Data to text" . All definition and data will copy to Sheet
- Data to fields: Define fields with 2 ways,
- Add Insert → Fields → Other, define your fields in "Database" tab.
- Mouse select field name,drag and drop field name to writer document。
Then select specified record then click "Date to field", field data will copy to specified field.
- Mail Merge: Mail Merge Wizard entry, this function is commonly used. (maybe this button is only enabled in Writer )
Others
- Tools → SQL for running SQL commands directly.
- Tools → Extension manager, extension plugins. Common used extensions
- “MySQL Connector for OpenOffice.org” ,
- Oracle Report Builder for more complex report. https://extensions.openoffice.org/en/project/reportdesign
- Use Other database like PostgreSQL(commonly used) (Use other database via extensions) https://wiki.openoffice.org/wiki/Base/connectivity/PostgreSQL
- Tools → Options → OpenOffice Base connection pool…
connection pool for performance, but only some defined drivers, these drivers are not used frequently。Need deeper investigate it's benefit.
- Tools → Tables Filter
No effect as Help, not hide as filter definition, need deeper investigate.
- Small notes
- All reports are based upon a single table or query. So you need first to decide what fields you want to use in the report. If you want to use fields from different tables,
- you must first combine these fields in a single query. Then you can create a report on this query.
- Report: The Author in Report is the name you listed in Tools → Options → OpenOffice → User Data.
- Have different context menu in CSV database client. With a CSV database the "MaxRowScan" setting allows to define how many rows should be scanned to find the correct type of a column. In the past only the first row was scanned.
Common defects from AOO mail list
Mail title | Main content | comments |
---|---|---|
Crash in Calc with database | Memo field., register a database in Calc via macro | |
Mailmerge from a Database query produces blank document | Mail merge from a database query | |
Dragging a query into a sheet | Drag a table or query to a sheet(export)(not registered database type, separate) | Copy and paste is ok, but drag and drop have the same problem |
Postgresql-sdbc-0.7.6b installs, Postgres not an option in "Connect to existing Database" pick list | Use extensions to add other database not in pick list. Extensions about database need pay attention. |
Postgresql is used frequently |
AOO database denies to open the odb file | Use three not including Filter. Open and reload |
With Filter |
RPT: report could not be reopened after 'save as' the database document | Save to another name, can't execute report normally. | Save and Reopen |
Desktop frozen on database log-in | Registered database with password protect. | Need consider data with security protect. Test use Spreadsheet, MS sheet is ok, MS sheet with password can't registered. OO sheet with/without password can't registered. |
Can not make form in Base only installation | Installation, If you select to install ONLY OpenOffice Base, you have to install also OpenOffice Writer | Install Base stand-alone. TBD:what is OpenOffice Writer |
Install JDBC and ODBC driver
https://wiki.openoffice.org/wiki/Connect_MySQLandBase
Install MySQL JDBC driver
- download JDBC driver from official website. Like download MySQL driver from https://www.mysql.com/products/connector/
- Unzip file
- add driver archive (jar)
Tools → Options → OpenOffice → Java, then click Class path , then click Add archive button, then open appear in the list of Assigned folders and Archives.
OK then restart the program (restart include the Quickstarter), will take effect. (need verify db is running)
Install MySQL ODBC driver
- download ODBC driver from official website
- Navigate to Control Panel > Administrative Tools and double-click on Data Sources (ODBC)
- on the User DSN tab Click Add button and from the list of available drivers, select the MySQL ODBC Driver, and click OK.
- Input requires data in the appeared dialog.
https://wiki.openoffice.org/wiki/Base
https://wiki.openoffice.org/wiki/Connecting_to_Microsoft_Access
https://wiki.openoffice.org/wiki/Documentation/How_Tos/Using_SQLite_With_OpenOffice.org
FAQ & TBD
Q: How to use address book.
Q: How to use Connection Pool to improve performance with AOO given drivers