Creating The Rocketry Research Assistant Database: Practical Database Programming Using Libreoffice Base
Creating The Rocketry Research Assistant Database: Practical Database Programming Using Libreoffice Base
Creating The Rocketry Research Assistant Database: Practical Database Programming Using Libreoffice Base
Rocketry Research
Assistant Database
Part 1
Practical Database Programming
Using LibreOffice Base
Robert W. Austin
NAR 47533
Copyrighted 2023
1|Page
Creating the Rocketry Research Assistant Database
Part 1 © 2023
by Robert W. Austin is licensed under CC BY-SA 4.0.
To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/
2|Page
The Austin Aerospace
Educational Network
The Austin Aerospace Educational Network (AAEN) is a network of sites that is designed to
provide you with the resources you need to perform a wide variety of projects using model
rocketry. Model rocketry is a wonderful hobby, a great educational tool and just a world of fun.
Model rocketry can provide a window that allows you to looking towards the future, be active in
present day events and peer back into history and learn from those who have gone before us.
If you like working with technology, model rocketry and computers are made for each other.
You can use software to design your own model rocket and make sure it is stable so it will fly
straight and true. You can create simulations of how your model rocket will perform using
different motor or fin configurations. You can conduct real research projects.
How about electronics? Thanks to small micro-controllers like the Arduino and ESP 32 as well
as single board computers like the Raspberry Pi, anyone can add real electronics and avionics to
their rocketry projects.
You can incorporate 3D printing to create parts that currently don’t exist or to bring old designs
long since removed from store shelves back to life. This offers the rocketeer a way to create
components for their rockets and support systems that couldn’t have been imagined even 10
years ago.
But perhaps the best news is that we have only begun to scratch the surface of the hobby, as there
is so much more that you can do with model rocketry. Our intention is to provide you with a full
array of information on the wide and wonderful world of model rocketry, what I consider the
most fascinating hobby on the planet!
3|Page
We have a section that focuses on the Arduino micro-controller and how it can be used in
model rocketry.
We have a section set aside for 3D printing. Currently we have an article on using 3D
printing to build a Dyna-Soar Titan II model rocket.
There is a page for Model Plans. There are two plans currently available, but more are on
the way.
The Austin Aerospace Education Network (AAEN) has been developing the open source
Flight Logs Database Program. The software can track your rockets from initial
construction, then track all flights and record any maintenance needed or performed. It
can calculate altitude, record any 3D prints used on the model, store the plans and even
report CATOs to the MESS (Malfunctioning Engine Statistical Survey) site. If you are a
NAR member and looking at completing your NARTREK submissions for the Bronze,
Silver or Gold levels, it can help with that as well. There’s even more the software can do
for you. Read more about it on the Flight Logs Software page.
Printables
https://www.printables.com/social/173143-austin-aerospace-education/models
Thangs
https://thangs.com/designer/Austin%20Aerospace%20Education
CAD Files
TinkerCAD
https://www.tinkercad.com/users/kGt9Dmmc88b
Project Instruction/Tutorials
Instructables
https://www.instructables.com/member/Austin_Aerospace_Education/instructables/
YouTube
Rocketry Research Journal Video Channel
https://www.youtube.com/@AustinAerospace
4|Page
Table of Contents
01 Introduction to LibreOffice and Base.....................................................................................8
Additional Information................................................................................................................8
LibreOffice Base..........................................................................................................................8
HyperSQL................................................................................................................................9
Firebird.....................................................................................................................................9
Other Database Engines...........................................................................................................9
02 About the Database Project...................................................................................................11
A Note About Microsoft Access................................................................................................11
Transition to LibreOffice Base..................................................................................................12
Creating an Educational Project.............................................................................................13
03 Designing the Database...........................................................................................................15
What is the Process to Create a Database?................................................................................15
1. What is the purpose of the database?.................................................................................15
2. Information research and organization..............................................................................15
3. Information is sorted into tables........................................................................................16
4. Information details become fields......................................................................................16
5. Identify the Primary Key...................................................................................................17
6. Relationships......................................................................................................................18
7. Improve the design of the database....................................................................................18
8. Normalize the database......................................................................................................19
Ready to Start Coding? Not So Fast..........................................................................................20
Project Table..........................................................................................................................20
Task Table..............................................................................................................................21
Team Members Table............................................................................................................21
Close, But Not Yet Ready to Code............................................................................................24
Reviewing Table Fields.........................................................................................................24
Lookup Tables.......................................................................................................................25
Field Types.................................................................................................................................26
Integer Field Types................................................................................................................27
Floating-Point Fields..............................................................................................................27
Text Fields.............................................................................................................................28
Date and Time Fields.............................................................................................................28
5|Page
Miscellaneous Fields..............................................................................................................28
Final Table Design.....................................................................................................................29
Relationships..........................................................................................................................33
04 Creating the Database Tables................................................................................................34
Create the Database....................................................................................................................34
Database Registration............................................................................................................35
Table Wizard..........................................................................................................................36
Creating Tables..........................................................................................................................37
Tasks Table............................................................................................................................37
Complete Creation of the Tables...........................................................................................40
Relationships..............................................................................................................................40
Create Relationships in Base.................................................................................................41
Edit Relationship Links..........................................................................................................42
Populate Lookup Tables with Data............................................................................................43
05 Creating Database Forms.......................................................................................................45
Creating the Members Form......................................................................................................45
Step 1 - Select Fields to Display in the Form........................................................................45
Step 5 – Arrange Form Controls............................................................................................46
Step 6 – Data Entry Mode......................................................................................................46
Step 7 – Form Style................................................................................................................47
Step 8 – Form Name..............................................................................................................47
The Wizard Result.................................................................................................................47
Modifying the Members Form...................................................................................................48
Resizing the Text Boxes........................................................................................................48
Arranging the Data Fields......................................................................................................49
Cleaning Up Labels................................................................................................................50
Updating Date Boxes.............................................................................................................50
Converting Drop-down List Boxes........................................................................................51
Formatting Phone Numbers...................................................................................................52
Form Title..............................................................................................................................54
Activation Order....................................................................................................................54
Additional Forms.......................................................................................................................55
The Projects Form..................................................................................................................55
Task Form..............................................................................................................................58
6|Page
Finishing Up Our Forms............................................................................................................59
06 Thoughts on Improving the Rocketry Research Assistant.................................................60
Reports.......................................................................................................................................60
Additional Forms.......................................................................................................................60
Additional Data Fields...............................................................................................................60
Error Correction.........................................................................................................................61
Database Engine.........................................................................................................................61
Split the Database..................................................................................................................61
Help File.....................................................................................................................................61
07 Conclusion...............................................................................................................................62
Appendix.......................................................................................................................................63
A1 LibreOffice Base Edit Mask Key..........................................................................................64
A2 Tables......................................................................................................................................65
A3 Relationships...........................................................................................................................69
A4 Relationship Graph................................................................................................................70
A5 Sample Forms.........................................................................................................................71
A6 Data Types for the Table Editor*..........................................................................................74
A7 Properties of Controls‡..........................................................................................................76
A8 References...............................................................................................................................78
7|Page
01
Introduction to
LibreOffice and Base
This Project Manual will focus on database programming using the Base program in the
LibreOffice Office Suite. LibreOffice is a free and open source suite of office programs that
includes:
• Writer – Word processing program
• Calc – Spreadsheet program
• Impress – A presentation program
• Draw – A vector graphics editor, raster graphics editor, and diagramming tool
• Math – A program to create math formulas for use in Writer and Calc
• Base – A database management program
LibreOffice is cross-platform and available on Windows, Linux Mac OS and a variety of other
operating systems. It can also
import and export documents in
a wide variety of formats,
including those used by the
Microsoft Office Suite.
LibreOffice can be downloaded
for free through The Document Foundation at https://www.libreoffice.org/download/download-
libreoffice.
Additional Information
The Document Foundation has released a number of guides on using LibreOffice. There are
separate guides for each section of LibreOffice, including Base. These can be found at
https://documentation.libreoffice.org/en/english-documentation. They are free to download in a
number of formats. You can also purchase printed copies of the guides if desired. If you plan to
work a lot with Base (or any of the other sections of LibreOffice) it would be to your benefit to
download the guide you need.
LibreOffice Base
Creating a database program involves a number of different steps. We will need to develop a
basic design for the database, create tables that hold the data, develop forms that allow data to be
easily entered and displayed, create queries that allow us to manipulate the data to get
information out of database, and generate reports that provide the data in an easy to read format.
In this part of the development process we will focus on creating the database tables and a few
primary forms.
8|Page
LibreOffice Base is actually two programs. The data is stored in a database called the HyperSQL
Database, or HSQLDB (http://hsqldb.org). HSQL database is an open source relational database
that is 100% Java. The database (the tables that store the data) is often referred to as the back-end
of the database. The front-end (forms, queries and reports) is handled by LibreOffice Base. The
HSQL database is embedded into the Base program, so that it appears as a single program. This
has advantages in keeping everything together in a single file (seen as the file extension odb in
LibreOffice). It is an easy database program to use and for basic projects (such as the one in this
manual) it works very well.
HyperSQL
The version of HSQL used by LibreOffice is Version 1.8. This was released in July of 2005.
HQSL has been updated a number of times since then, and as of this writing is at version 2.7.1
released in October 2022. HSQL requires the Java Runtime environment to work. Java is also
required for other parts of Base to function properly besides HSQL.
It is possible to use the current version of HSQL in your database, but it will take some work.
For details on how to use the latest version of HSQL visit their web site at
http://hsqldb.org/web/openoffice.html.
Firebird
LibreOffice Base also allows the use of Firebird as the embedded database engine. However, it is
considered ‘experimental’ and is not available by default. To allow Firebird to be available, go to
Tools → Options → LibreOffice → Advanced → Optional Features and check the box to
“Enable experimental features” and then click OK. You will need to restart LibreOffice. After
the restart Firebird will be available to use as an embedded database.
LibreOffice uses version 3.0 of Firebird, released in 2016. It was included for the first time in
LibreOffice in version 6.1 released in 2018. Firebird is currently on Version 4.0 released in
August of 2022, while their BETA Version 5 was released in March of 2023.
There are a number of differences between HSQLDB and Firebird DB. HSQL requires Java,
while Firebird is written C++. A comparison of the two database engines can be viewed at
https://books.libreoffice.org/en/BG73/BG7312-AppendixB-CompareHSQLDBAndFirebird.html.
If you wish to migrate your database from HSQLDB to Firebird, this guide will be of help
(https://wiki.documentfoundation.org/Documentation/FirebirdMigration). To read more about
Firebird in Base visit https://wiki.documentfoundation.org/Development/Base/FirebirdSQL.
9|Page
Using the default settings in Base places everything in a single file. While convenient it can lead
to problems of data corruption if the software has problems saving the file. For this reason, it is
often advisable to split the database into two separate parts; the back-end and front-end. Should a
problem occur in saving the front-end resulting in a corrupt database, the back-end is unaffected
and the data is still sound and usable. In this case our database is small and we are unlikely to
encounter this issue. However, as your database projects grow, and especially if you share the
data among multiple team members on different computers, splitting the database should be
given serious consideration.
10 | P a g e
02
About the
Database Project
Both research and engineering projects collect a lot of data. Data is collected during the
development of the launch vehicle and payload. Data is collected during testing of the system,
and data is collected during the actual flights. Working with data doesn’t stop there. Once the
data has been collected it must be reviewed to make sure that the project is performing as
expected. Data analysis is a critical part of any research or engineering project.
To help with a basic understanding of how databases are constructed and how they can be used
we have created the Rocketry Research Assistant (RRA) database project. In this project we will
take you step by step through the design, development and use process. We will start with the
design of the database and figuring out what we want the database to do (the objectives) and
what information the database should store to meet those objectives (if you haven’t read Tech
Report 11 “Introduction to Database Design” we would encourage you to do so before
proceeding with this project). Next is developing the tables that will store the data and creating
the relationships that allow the database to function effectively. Then we start to create the forms
that the users will interact with, followed by the queries that will provide the data needed for the
forms or reports. Finally we will design the reports that will help us look at the data in ways that
are helpful to the management of our research project.
The database project created here is intended to be the foundation of your future database
projects. By creating this project you will learn the basics of database creation. The next steps are
up to you. Do you want to expand the project with additional forms, tables and reports (we will
discuss this in more detail during the review process at the end of the manual)? Do you want to
create a new database that helps with the project you are currently working on? You might want
to look at how to share the database among other team members by taking the database and
splitting it into a front end and back end. There is also the option of incorporating the spreadsheet
program Calc into the project to crunch numbers from a data collection research project. Or
include it in the word processor Write to help create your research project reports.
This project is designed to get you started. To make you aware of how databases work. To help
you understand how they can be helpful in your research projects. To let you know that you can
develop basic database programs and skills that can be immensely beneficial to you and your
team.
11 | P a g e
Microsoft Access 2010. It used the Access runtime module to allow anyone to run it on their
Windows computer without having to install Access on their computer.
One of the problems with using Microsoft Access is that it is Windows only. This meant that it
could not be used on other operating systems like Linux or Mac. This became a concern and we
debated how to approach this issue while continuing development on the Flight Logs software.
Then on August 8, 2022, Microsoft announced that Windows updates would block VBA (Visual
Basic for Applications) macros that originate from the Internet (https://learn.microsoft.com/en-
gb/DeployOffice/security/internet-macros-blocked). Further, a banner would be displayed
indicating that there is a security risk involved in running the software.
This gave us pause, as Microsoft was stating any software created using VBA was unsafe and
untrusted. It didn’t matter who created it. It didn’t matter what the software did. There was no
testing to see if there was anything wrong with the software. Just a blanket condemnation of a
program simply because of the use of VBA.
There was a followup announcement by Microsoft on January 17, 2023, which stated that an
upcoming Windows update will scan a user’s computers to “identify the number of users who
are running out-of-support (or soon to be out-of-support) versions of Office, including Office
2013, Office 2010, and Office 2007.” (https://support.microsoft.com/en-us/topic/january-17-
2023-update-for-office-2013-office-2010-and-office-2007-kb5021751-f4a23c1d-4d1f-44ba-
a43a-7a5528afb4ea).
Given that Microsoft is already blocking software that uses VBA/macros and putting up scary
banners, along with the recent news of their plan to scan for old versions of the software, I firmly
believe that Microsoft will soon have formidable barriers in place to stop the software from
running.
It is very discouraging to invest the amount of time in developing a program such as Flight Logs
and see a warning banner indicating it is “security risk.” Such “warnings” can give the
impression the other items I provide through the web site are also a security risk.
Going back and reviewing how we should proceed with our database development activities, it
became very easy to answer. When we combined the limitation of Access being Windows only
along with the updates by Microsoft to restrict the use of Access (and Access 2010 in particular),
it was decided that we would begin to transition to another database management system.
12 | P a g e
including x86-64, IA-32, ARMel, ARMhf, ARM64, MIPS, MIPSel, PowerPC, ppc64le, S390x,
and VLIW (a version of LibreOffice runs on my Raspberry Pi 400). This extremely wide variety
of systems and platforms makes LibreOffice a very flexible and wide ranging program, and
makes Base available to a wider audience of users. It is also free and open source, so there is no
need to purchase a license to use the software.
LibreOffice Base also has the ability to create a database project as a single file using the
embedded HSQL database engine (it can also use the embedded Firebird database engine). For
small teams, single users and others, this has the advantage of not requiring a full database server
to be set up. If the user is working with a larger team or on a network, the LibreOffice Base
project can be split into a front end and back end for use on a database server. Much like Access,
it can be easily adapted to meet the needs of a wide range of users. All of this made the decision
to transition to LibreOffice Base from Microsoft Access not only easy, but it really is an upgrade
for the users who will be using the software.
Having resolved to transition to a new database engine, the next question was to decide if we
wanted to recreate the Flight Logs program in Base, or should we start a new database program.
We decided that given the educational direction of the AAEN that it would be better to start
development of a new database called the “Rocketry Research Assistant.” This database will
have an initial focus on tracking research project teams for various projects. Later it will be
expanded to cover other areas involved in research projects. You will no doubt be able to see
where certain parts of Flight Logs will be incorporated into future releases of the Rocketry
Research Assistant.
Beginning with the next chapter we start with the initial design of the database. It describes how
the initial tables and their relationships are created. Then we discuss the actual creation of the
tables and how to construct their relationships in the database. We will show you step-by-step
how we created these first forms, including a number of screenshots to help you see exactly what
we did. We also discuss some options that you might want to consider in your own database.
This initial release of the Rocketry Research Assistant included this Project Manual. Each
subsequent release of the RRA will also come with its own Project Manual, showing what was
added, changed or deleted since the previous release. As database development continues we will
explain how we designed our queries, what is SQL, and more. We will create reports that allow
you to present project information in useful ways and we will look at how the RRA database can
integrate with other parts of LibreOffice, including Calc and Writer.
13 | P a g e
We hope that you agree that this transition to LibreOffice allows us to meet so many more
objectives than could ever be obtained had we continued to use Microsoft Access. We also hope
that you agree with our decision to use this database development project as an educational
project in itself. Finally, we hope that you agree with these decisions and will join us as we begin
this new series of database development projects.
14 | P a g e
03
Designing the
Database
What is the Process to Create a Database?
In Tech Report 11 “Introduction to Database Design” we describe an 8-step process to designing
databases. In the development of the Rocketry Research Assistant (RRA) we will use that same
8-step process.
We also need to know all of the tasks needed to complete the project and the priority of each task
in the project. We need to know who is the leader of each task. When is the task due, what is the
current status of the task, and how far along the team is to completing the task.
15 | P a g e
• Task Information
◦ Name of the task
◦ Project the task is assigned to
◦ The priority of the task
◦ Who is assigned to the task
◦ Due date
◦ Date started
◦ Percentage of task completion
◦ Date task is completed
• Team Member Information
◦ Name
◦ Email address
◦ Mobile phone number
One thing to notice is that as we drill down through the information we begin to discover
information that we need to track that at first may not be obvious. In item 1 we just had two main
items – Projects and Tasks. Now we know that we will need at least one more area for Team
Members.
Project Table
Project Name Text
Project Lead Member Text
Project Type Text
Project Overview Text
Project Objectives Text
Project Start Date Date
Project Due Date Date
Project Completion Percentage Number
Project End Date Date
16 | P a g e
Tasks Table
Task Name Text
Task Project Text
Task Priority Number
Task Assigned Member Text
Task Date Due Date
Task Date Start Date
Task Completion Percentage Number
Task End Completed Date
The information is beginning to look like a database, but we still have a way to go yet before we
start creating our tables in Base. Let’s look a bit closer at our tables and see how we can improve
them.
In two of our three tables we don’t have any data points that meet the requirements to be a
primary key. However, we can create an auto-increment field that will start with the number 0
and increase it by 1 for each record. There will never be any doubles. I use the identifier prefix
“ID_” to show that this is an auto-incremented field.
To use this in the Project Table we will create a field called “ID_Project” and it’s data type will
be a number that auto increments. We’ll do the same thing in the Tasks table, creating a field
called “ID_Tasks” that also auto-increments.
That leaves us with the Team Members Table. You might be considering using the Phone
Number as a Primary Key. It seems to work, as it is unique to the person. However, there is a
problem with using the phone number. What if the person gets a new phone with a new provider.
They may get a new phone number. Once we change the number the key no longer works.
Instead, lets do the same thing we did with the other two tables and create an auto-increment
field called “ID_Member”. We now have a Primary Key for all three tables.
17 | P a g e
6. Relationships
In this step we look at how the tables interact or ‘relate’ to each other. Here are the relationships
that are currently present in the database.
• Project Table relates to the Tasks Table
The Tasks Table needs to know the name of the Project each task is assigned to
• Members Table relates to the Project and Tasks Tables
Both the Project Table and the Tasks Table will need a person from the Members Table
assigned to each project and each task
While we have identified these relationships we can’t assign them yet in the database. This is due
to the fields have different data types. We’ll tackle that later in the Project Manual.
Member Name
All three tables have a data field for a member’s name, and all three have it as a text field.
However, one of the problems that becomes apparent is that we could have a wide range of
entries in these fields that all identify the same person. For example, in the Team Members table
my ‘legal’ name of “Robert W. Austin” might be used. In the field for Project Lead, the user
might enter my name as “Bob Austin” as that is what I typically go by. In the Tasks table my
name might be entered as “Bobby Austin”. All three of these names identify me, but to the data
base they are three different people. It gets worse if the user misspells the name, such a “Bobby
Austn”. Or they may use a different spelling of the name, such as “Robert Alston”.
These types of data entry issues need to be identified and corrected so that every person uses the
same identifier. This will keep the data consistent. The easiest way to make this consistent is to
use an identifier for the member rather than having the user type in the members name. We can
use the ID_Members as this identifier.
Data Type
When we setup the identifier in all three tables we decided to use an auto-increment number.
That field uses a type of number call an Integer. Integer data types hold numbers that are whole,
or without a decimal point.
When you look at the Project and Task tables, both of the Member fields are listed as Text fields.
You cannot create a relationship where the fields have different value types. To allow the
Member fields in these tables to link to the Members Table we need to change their value types
to Integer as well. Do not make these fields auto-increment – only the ID_Members should be set
to auto-increment. Once the text fields are changed to integer fields, we can create these
relationships. We can see this relationship in the figure on the next page.
18 | P a g e
Relationships between Members table and the Project and Tasks tables
Relationship Types
If you look at the lines that connect the Members table to the Project and Tasks tables you will
notice there is a number and a letter at each end of the line. These identify the type of
relationship that has been created. In this case both of these relationships are classified as “One-
to-Many.”
In a “One-to-Many” relationship there is one record in a table that may be associated with many
records in another table. In our Team Members table there is just one entry for each member (the
‘one’ in these relationships). But that member may be the leader in several projects or assigned
to a number of tasks (the ‘many’ in these relationships).
There are two other common relationships that you may see in a database. They include a “One-
to-One” relationship and a “Many-to-Many” relationship. Neither of these are used in this
database at this time. We do describe these relationships in Tech Report-11 “Introduction to
Database Design.”
19 | P a g e
to create a list of objectives in this single field. We need to correct this as part of our 1NF
process.
Since the objectives will be a list we can create a new and separate table for them and link it back
to the Project Table. This table can be rather small, consisting of just three fields:
• ID_Objective
• ProjectID
• Objective
To create this relationship we will simply need to link ProjectID in the Objectives table to
ID_Project in the Project table. Now we can have as many objectives as we want. We have
started our first round of database normalization.
Project Table
We have already seen how we can keep our data more accurate by making a separate table for
team members and linking it to the Project table. Are there other areas in this table that we can
improve upon?
The fact that we have a Project table indicates that we believe more than one project will be
tracked. It would be reasonable to assume that you may have multiple projects running
simultaneously. If that is true then we need a way to prioritize the various projects. If one project
is required while another is just for fun, we should be able to rank them on a priority level. In this
case we can add a new field for Project Priority.
Another field that you might consider is the current status of the project. Is the project in the
planning stage? Is it in the flight test phase? Has the project been concluded? Here are some
common terms related to project status:
• Upcoming: This is a project that's still under review.
• Active: The project is approved and work is still being completed.
20 | P a g e
• Not started: The project is approved but has not been started yet.
• Pending: The project has been approved and but an item is missing that prevents the work
from getting started.
• Overdue: The project is still in progress but that the deadline for completion has passed.
• Canceled: The project is no longer active before all work was completed.
• Completed: The project is finished.
This simple field can be very valuable later when sorting projects or getting an idea of how far
along each project has progressed. We will call this field Project Status and set it as a text field.
Another field that we might consider is a “Notes” field. We have a field that provides an
overview of the project and we are going to link to a table with our objectives, but if we want to
write a note about the project we don’t have anywhere to do that. A Note field can be used as a
type of ‘catch-all” – a place to insert comments or data that may not be captured elsewhere. If
you find it is collecting a lot of similar data it can motivate you into updating the database with a
new field or even a new table to collect that data. In this case we will simply create a new called
field called Notes as assign it as a text field.
Finally, most projects have a logo. We can include it in our database by creating an image field.
Later when we create forms and reports we can include the logo to help identify the project. In
our Project table we can add the field “Project Logo” and set it as an image field.
Task Table
Looking at the Task table there are some additional fields that we may want to add. Some of
these will be similar to the new fields added to the Project table. We probably want to add a
Status field so that we can track what tasks have been completed, which ones are being worked
on, etc. We may also want to add categories to the types of tasks. This will allow us to see where
the work is being performed, and what area dominates the workload. It can also help us see if
there is an area where things a bogged down. We should probably add a Notes field here as well.
Begin by breaking the field “Name” down into its component parts. This will include:
• Prefix (such as Dr., Mr., Miss, etc).
• First Name
• Middle Name
• Last Name
• Suffix (Jr., Sr., III, etc.)
By breaking the name down into the individual components we can more easily work with the
data. You can sort by last name or first name. You can use just the first name on an informal
email communication, or you can include the member’s full name for more formalized
documents. This is also helpful in avoiding duplicate names. So now instead of one field we now
have five fields for an individual’s name.
21 | P a g e
Not mentioned in the first draft of the table is the member’s address. You will likely want to
obtain the address if you want to send things to the physical residence of the member. An address
may be needed if you use the database to complete applications for events that require each team
member’s place of residence. Its common to add two address lines; one for the street address and
the second for things like apartment numbers.
Another item you may wish to add is the member’s birthday. This may be needed to verify the
age of a team member for an event or to purchase items. A current picture of the individual can
be stored much like the logo in the Project’s table.
You might want to track some of their team information, such a when they originally joined the
team, their current status (are they active, did they resign, etc), if they are qualified to act as a
project lead member, and when they left the team.
Like before, we may want to add a Notes field to address anything that is not covered in the
established fields.
We have made a number of changes to our original tables as we have gone back and reviewed
them. This is part of the on-going design cycle and we are not quite done. Let’s look at our tables
as they are currently designed.
Objectives Table
Key Field Name Type
ID_Objective Auto
ProjectID Number
Objective Text
Tasks Table
Key Field Name Type
ID_Tasks Auto
Task Project Text
Task Name Text
Task Category Text
Task Description Text
Task Priority Number
Task Assigned Member Text
Task Date Due Date
Task Date Start Date
Task Status Text
Task Completion Percentage Number
22 | P a g e
Task Completed Date
Tasks Notes Text
Project Table
Key Field Name Type
ID_Project Auto
Project Name Text
Project Type Text
Project Overview Text
Project ObjectivesID Number
Project Priority Number
Project Lead Member Number
Project Start Date Date
Project Due Date Date
Project Status Text
Project Completion Percentage Number
Project End Date Date
Project Notes Text
Project Logo Image
23 | P a g e
Email Address Text
Mobile Phone Number Number
Alternate Phone Number Number
Birthday Date
Joined Date Date
Current Status Text
Project Lead Qualified Y/N
Separated Date Date
High Power Certification Y/N
High Power Certification Level Number
Notes Text
Member Photo Image
Objectives Table
This is now our smallest table. It’s job is to assign objectives to the correct project. We can leave
it as is, or we can modify it slightly by adding a priority to the objective. For example, lets say a
project has six objectives, but all six may not carry the same importance. Three of the objectives
may be absolute requirements. They have to be accomplished as part of the project. Two of the
objectives may be secondary, requirements that should be completed if possible. The project will
try to carry out these two objectives, but not at the expense of the three absolute requirements.
Our last objective may be one that would be nice to do, but no one is losing any sleep over it if it
never occurs. Given this is a real probability, lets add a priority to the objectives table.
Tasks Table
The Tasks table looks pretty good. With what we are attempting to accomplish with this database
project it appears we are in good shape. At this stage of our database development we don’t want
to get into things like materials and budgets. We can add that in later if desired. For now, there
are no additional adjustments needed here.
24 | P a g e
Projects Table
This table also looks good. Again, we are not going to be looking at budget days. At this stage of
the development process as we are keeping it simple. This table looks ready to go.
Members Table
The Members table had the greatest amount of changes of all the tables in our database. It went
from being one of the smallest tables to the largest. When you have big changes like this, it is
wise to go back and look them over. Will the changes you’ve made do what you expect, or did
they create bigger issues?
The changes in this table have mostly added detail to the member’s information. This detail will
be useful when completing applications and reports. There is one area that we may want to add
and this is tracking if the member is certified for High Powered Rocketry (HPR) flights. There
are three HPR certification levels. If it is possible the project you are working on will involve
HPR, we should add this to the Member’s table
With these few changes, it appears we have the fields we need in our database. Let’s look at one
more item and that is the subject of what I call “Lookup Tables”.
Lookup Tables
Lookup tables are tables that contain a “Master List”. These are typically very simple tables that
contain a primary key and a description, and no value appears more than once. For example a
lookup table of US states would contain the state name and a primary key. This types of tables
allow you to “lookup” information and connect it to another field in your database.
Lookup tables are very useful, especially when you want to make sure there is consistency in
your data. Consider one of the fields we have in three of the tables:
• Project Priority
• Objective Priority
• Task Priority
One user might enter the priority as a number, 1, 2, or 3. Another user may use terms such as
Critical, Major, Minor and Trivial. Another might like the terms High, Medium, and Low. While
there is nothing wrong with any of these terms, if all are used at the same time it will be very
difficult to determine what each priority means and if its use is correct. Is a High priority more
important than a Critical priority? We can avoid this by using a lookup table and restricting the
user to entering only the terms in the lookup table.
Another way of thinking about lookup tables is how a user will interact with that table through a
form. Going back to our lookup table that provides a list of US states, it would be rather common
to see this as a drop-down box on a form. Instead of the user typing in a state, they would simply
select the state from the options listed in a drop-down box. With this in mind, lets take another
look at our tables and see where we can use lookup tables.
25 | P a g e
Priority Lookup Table
We discussed this one in the preceding section, so let’s start with it. This would be a two column
table consisting of an ID and the priority text. This can be used for the Project Priority field, the
Objective Priority field, and the Task Priority field. These fields will link back to the Priority
Lookup Table ID.
Tasks Category
This lookup table will only be used in Tasks table and is constructed like the two previous tables
– an ID and the category text.
Project Type
This lookup table is only used in the Project table. Once again a simple ID and Type text link
back to the Project Type field.
That should do it for the lookup tables. We still have two more areas that we need to clean up
before we start coding; Field Types and Field & Table notation.
Field Types
As we started the design of our database we used very generic terms in the field type. Terms
such as “Text”, Number”, and “Date”. As we get ready to finalize our design we need to get
specific on the field types. It is very important that we get this correct now. If we try to change it
later it can lead to all types of problems including a loss of data. Time spent determining the
correct field type is time well spent.
Field types will vary depending on the underlying database. While there is some similarity and
overlap between the various databases, you must use the field types that are specific to the
database you are using. In this project we are using the built-in database engine in LibreOffice
which is the HyperSQL database management system, or HSQLDB. We can break down the
HSQLDB field types in general categories and then look closer at each specific type.
26 | P a g e
There are two general number categories – Integers and Floating Point numbers. It also has
several Date/Time fields as well as Text fields. We round out the categories with several
miscellaneous field types. Let’s start with our number field types, specifically integers.
Floating-Point Fields
A Floating Point is a real number – a number with decimals. It has two components – an integer
number to the left of the decimal point and a fractional number to the right of the decimal point.
The point can float anywhere to the left, right, or between the significant digits of the number.
There are two pairs of floating point fields in HSQLDB.
• DECIMAL and NUMERIC
These are very large numbers that are extremely accurate. They range from -1038 +1 to
1038 -1. You define these numbers by specifying the total numbers of digits (or places)
allowed and how many of those digits will be placed after the decimal point.
Example: DECIMAL(8, 3) indicates 8 total numbers, with 3 of the numbers to the
right of the decimal point. The largest number allowed under this definition would
be 99,999.999.
• DOUBLE or REAL
These are large numbers that are no so accurate. They range from -3.40E + 38 to 3.40E +
38. You can have a maximum of up to 15 decimal places. For more precise calculations
and accurate rounding use DECIMAL or NUMERIC.
27 | P a g e
Text Fields
Text fields are strings of characters. HSQLDB has four types of text fields.
• VARCHAR
This is a variable length field that can contain a maximum of 8,000 characters. You
define the maximum amount of characters in the field up to 8,000. With VARCHAR it
only uses the amount of space actually used by the characters. If you define a field to
have 20 characters, but one of your entries is only 6 characters, the database will only use
the 6 spaces required.
• VARCHAR_IGNORECASE
Same as VARCHAR above except letter case is ignored.
• CHAR or CHARACTER
This is a fixed size field that can contain a maximum of 8,000 characters. Like
VARCHAR you can set the size of the field. If you define a field to have 20 characters,
but one of your entries is only 6 characters, here the database will pad the empty spaces
to fill up the full 20 characters. This type of field is useful when you have fixed field
sizes that always use the same number of characters.
• LONGVARCHAR
LONGVARCHAR is an extremely long field size, up to 16MB in size. This is useful for
extremely long blocks of texts such as articles.
Miscellaneous Fields
There are two other fields that we want to address that don’t fit into any of the previous
categories.
• BOOLEAN or BIT
This is typically considered as a two state field – Yes/No, True/False, On/Off. However,
there is actually a third state of NULL. NULL is not a condition that is used in this setting
very often.
• LONGVARBINARY
This is used for image files up to 16MB in size.
Now that we know how the various field types are used, it is time to go back and look at our
tables and adjust the generic field types to the more correct field types. While we are looking at
28 | P a g e
the field types, we also need to determine the lengths for some of these fields. By choosing the
proper length you can maximize the efficiency of the database.
The last thing to update before we begin the actual coding is to adjust field names. Field names
should not have spaces, as that can cause issues later when trying to write out your code. You
should also use field names that make sense. Don’t use shortcuts here. Use a naming convention
that will make sense when you come back to review your work a year from now.
I try to use the table name as the first part of the field name. In our current database design we
have three tables that use a field name of “Priority”. To help alleviate confusion I would make
the field names of the three “taskPriority”, “projectPriority”, and “objPriority”. It is easy to tell
which table the field resides by using this type of naming convention.
29 | P a g e
tblMembers (Team Members Table)
Key Field Name Type Length Required
ID_Members INTEGER (Auto)
memberNamePrefix VARCHAR (Text) 10
memberNameFirst VARCHAR (Text) 50
memberNameMiddle VARCHAR (Text) 50
memberNameLast VARCHAR (Text) 50
memberNameSuffix VARCHAR (Text) 10
memberAddress1 VARCHAR (Text) 100
memberAddress2 VARCHAR (Text) 100
memberCity VARCHAR (Text) 50
memberStateID INTEGER (Link)
memberZip VARCHAR (Text) 10
memberEmail VARCHAR (Text) 150
memberPhonePrimary VARCHAR (Text) 12
memberPhoneSecondary VARCHAR (Text) 12
memberDateBirth DATE
memberDateJoined DATE
memberStatusID INTEGER (Link)
memberProjectLeadQualified BOOLEAN (Y/N)
memberDateSeparated DATE
memberHPRCertification BOOLEAN (Y/N)
memberHPRCertificationLevel TINYINT (1, 2, or 3) 3
memberNotes LONGVARCHAR (Text)
memberPhoto LONGVARBINARY (Image)
30 | P a g e
tblProjects (Project Table)
Key Field Name Type Length Required
ID_Project INTEGER (Auto)
projectName VARCHAR (Text) 100
projectTypeID INTEGER (Link)
projectOverview VARCHAR (Text) 8000
projectPriorityID INTEGER (Link)
projectLeadMemberID INTEGER (Link)
projectDateStart DATE
projectDateDue DATE
projectStatusID INTEGER (Link)
projectCompletionPercentage TINYINT (0-100)
projectDateEnd DATE
projectNotes LONGVARCHAR (Text)
projectLogo LONGVARBINARY (Image)
31 | P a g e
lkupPriorities (Priorities Table)
Key Field Name Type Length Required
ID_Priority INTEGER (Auto)
Priority VARCHAR (Text) 75
One thing you may have noticed is that each table has a prefix to indicate its function. Tables
that start with the prefix “tbl” indicate that they are used to store data about the project and that it
often has changes and updates to that data. Tables with the prefix “lkup” indicates it is a lookup
table and the data stored here seldom changes.
32 | P a g e
Relationships
The following shows the relationships that will be used in this database design.
33 | P a g e
04
Creating the
Database Tables
In the last chapter we went through the preliminary design of our database. By the time we had
completed the exercise we had a total of five primary tables and six lookup tables. It is now time
to start the creation of the database and the development of the tables.
The second screen of the Database Wizard, “Save and proceed” should be highlighted and
displayed. If it is not, click on “Save and proceed” to bring up the screen.
34 | P a g e
On the right hand side of the screen you will see
that LibreOffice is asking “Do you want the
wizard to register the database in LibreOffice?”
The default response is “Yes, register the database
for me.” The second option is “No, do not register
the database.” (see section labeled as number 1 in
the graphic to the right). For now, let’s keep the
registration option selected.
A Save as… dialog box will now be displayed. You need to determine where you will be storing
your database. You need to select a
location on your computer or
network that is accessible and has
adequate space to store your data
(see area circled in blue and labeled
as 1 in the graphic on the right). You
will also need to give your database
a name. I have labeled mine as
“RRA” (for Rocketry Research
Assistant) and I follow this with the
current date. As I make updates and
changes I will save copies of the
database using a current date. This
way I will always know what is the
most current version I am working on, and I can go back to a previous working version if I screw
up the current version. Once you have the name entered, click on the “Save” button (shown as
the number 3). Now the database will be created and saved.
Database Registration
So what is database registration in LibreOffice, what does it do and why would I want to register
my database? Let’s look at what does and doesn’t happen during this process.
First off, when you register your database you are not sending your data to the LibreOffice
servers. Your data is not going anywhere. The folks at LibreOffice are not getting updates on
35 | P a g e
changes you make to your database or the data within your database. Your data never leaves
your computer (unless you decide to send it somewhere).
Secondly, it is not making an entry into the Windows Registry. Remember that LibreOffice is
not just a software program that can run under Windows, it can be used on a number of operating
systems including Linux and Mac. So the Windows Registry is not used here.
So what happens when a database is registered? It makes that data (the tables and queries)
available in LibreOffice Writer and Calc.
If you open up LibreOffice Calc, click on “View” on the menu and select “Data Sources” a new
window will open at the top of the spreadsheet. If this is the first time you have used Base, you
will probably only see the Bibliography database listed (this is the example database that comes
with LibreOffice). Click on the plus sign (+) next to Bibliography and it will be expanded to
show Tables and Queries. Click on the plus sign next to Tables and it expands to show the table
“biblio”. Click on “biblio” and the table and it’s data will appear to the right (see graphic below).
These same registered databases will also be available in the Mail Merge Wizard in Writer.
By registering your database, it makes it easier to work with the data in Writer and Calc. If you
don’t plan to have these programs interact, you do not need to register the database. It will not
affect the operation of the database at all.
Table Wizard
The one option we bypassed during the creation of the database was to use the Table Wizard.
The Table Wizard is designed to help you create tables based on the particular activity you are
tracking. There are two broad categories listed; Business and Personal. Sample tables will be
listed based on the category selection.
We did not use the Table Wizard because we had went through the design process prior to
creating the database. We have already determined what fields we would need and the field
types. One thing the Table Wizard does not do is help with setting up relationships. Since we had
already determined what we would track and the necessary relationships, there was no need to
use the Table Wizard.
36 | P a g e
As you develop future databases or as you
expand this database to better meet your
needs, it is recommended that you go through
the same design process we used in Chapter 3
and not rely on the Table Wizard. However,
there is nothing wrong with looking over some
of the fields that the Table Wizard
recommends for different types of tables. You
may find something that you missed during
the design process. You might find that some,
part, or all of their recommendations might be
what you want.
The main thing is to design the database yourself and not limit yourself to the recommendations
made by LibreOffice, or to remove a field from a table because it is not listed in their
recommendations. Always take the time to design your database so that you understand exactly
what you are tracking and how the data interacts.
Creating Tables
With the database created and registered we can turn our attention to the creation of the database
components. We will start with the creation of the tables and their relationships.
Tasks Table
We will begin with one of the primary tables in the database, the Tasks table. We already know
how this table will look, as we spent the time to plan it out earlier.
37 | P a g e
New Table to Tasks Table
The graphic on the right is a new table ready to be
designed. You will notice that it looks similar to the
tables we created in the last chapter as we were
designing the database.
ID_Tasks Field
The first item entered into the table is the Field
Name “ID_Tasks”. As we enter in the Field
Name you will notice that the Field Type
automatically changes to “Text [VARCHAR]”.
In the Field Properties section is has defaulted
to “Entry Require – No” and “Length” is set to
100. No default entry is given. This is the
default for every field that is entered into the
table. As this will be an Auto-Value field we
will need to change the entries.
Begin by selecting the drop-down box in the Field Type column and change it to “Integer
[INTEGER]”. You will notice that the Field Properties box has changed. When you change
Auto-Value to “True” you will see that the Field Properties box has changed again. Base does a
pretty good job of only showing you the options that are available based on your entry.
38 | P a g e
Next enter the field taskName. The default text field type will be displayed. We need to change
“Entry Required” to Yes, and we can leave the length at 100.
39 | P a g e
Save the Table
With all of the field information entered into the table,
make sure to save your progress. Click on the Save
icon in the upper left corner of the form (it looks like a
floppy disk). A single line dialog box will appear.
Enter in the name of the table and click the OK button.
The table is now saved as part of the database and will
appear in the Tables section on the Base main screen.
Relationships
Setting up relationships between tables is what actually allows the magic of relational databases
to occur. Data relationships are simply associations between data tables. In our data tables, all of
our tables currently have a ‘one-to-many’ relationship. This means that there is ‘one’ item in a
particular table that may be seen “many” times in a related table. For example, in our
membership table we will have a number of members. Each member will have an address that
40 | P a g e
includes the state they reside in. Our lkupStates table has each state listed once, while the related
State field in the Members table will have multiple occurrences of the state data. In this case the
lkupState is the ‘one’ and the tblMembers is the ‘many’. You can have other relationships as
well. They include a “one-to-one” relationship and a “many-to-many” relationship.
When you add each table it will place a box that shows all of the
fields in the table on the Relationship Design Screen. As each
table is added it is placed next to the previous table. It is unlikely
this is the layout you will need to make sense of the relationships
you need to create. Lets start by making the screen make sense
to us.
Grab each table and move it to the right side of the screen. First
move tblProject to the center of the screen. This is our main
table and most of the other tables will interact with it. Expand the box downward so that you can
read all of the data fields.
41 | P a g e
together in this “One-to-Many” relationship. This ability to create relationships between tables is
a very powerful tool and it is what makes relational databases so useful.
Lets complete the rest of the relationships needed in our database. All of our relationships in this
database are “one-to-many.” The specific relationships for the data fields in the various tables is
shown in the table in Chapter 3. The table identifies all of the relationships in our database,
including the one we have just created. It identifies the “one” side of the relationship and the
“many” side of the relationship.
As you work on creating your relationships, try to arrange the tables so that it makes sense to
you. You should strive to make the relationship diagram as clear as possible. Wherever possible,
try not to cross relationship lines. When you do have to cross lines, try to make the clear which
line belongs to which pair of fields. You want your relationship table to be understandable so
that others can look at it and comprehend what you are doing. When you have completed linking
all of the relationships in the database, you should have a Relationship Design Screen that looks
similar to the one below.
42 | P a g e
This will bring up the Relations dialog box. At the top it shows both tables involved in the
relationship. Underneath is the fields involved. There are a series of radio buttons near the
bottom. These are used to identify what will be done if the primary key is updated or deleted.
The default action for both is no action taken.
What if the record is deleted? The same four options with slightly different results.
• No action
It will delete the primary key record, but will not delete any associated records. It is best
to avoid this option as it results in error message the end user probably won’t understand.
• Delete cascade
It will delete the primary key record and all associated records.
• Set NULL
The primary key record is deleted. All associated records will have the foreign key set to
NULL.
• Set default
If the primary key is deleted, the value of the foreign key originally linked to it is now
changed to the default value.
In our database we want both the updates and deletions to cascade. Click on the Update and
Delete buttons and then click OK. Do this for all of the relations in our Club database.
43 | P a g e
This completes the creation of our database tables, both lookup tables and main tables. All of this
is what is typically referred to as the ‘back-end’ of a database program. When we “split” a
database this is the stuff that resides on the “back-end,” typically on a server. This data can be
made available to everyone who needs access to it.
In the next chapter we will begin work on the front-end of the program, starting with the creation
of the database forms. This is the interface that your users will employ to interact with the
database.
44 | P a g e
05
Creating
Database Forms
Forms are the primary method that most users will interact with a database. The first form we
will create is the Project Members form. This form is based on the Members table (tblMembers).
It includes the member’s demographic information – all of the information that was setup as part
of the Members table. We will start the creation of the form using the Form Wizard.
45 | P a g e
window, then clicking on either the up and down arrows to the right of the window. Once you
have all of the fields, click on the “Next” button at the bottom of the dialog box.
We skip Steps 2 through 4 as we are not creating a subform to use with this form
46 | P a g e
Step 7 – Form Style
The next step in the Wizard is to select a
style for your form. Like the Form Control
Arrangement screen, this will get you
started and you can always go in and
change things around (which we will do
shortly).
47 | P a g e
Modifying the Members Form
If you have closed out the Member’s form you will need to open it
so we can begin making changes. From the main database window,
click on the Forms icon in the Database column like you did when
starting the Form Wizard. You should now see the form
frmMembers listed in the Forms window. Right click on the form
listing and select “Edit…” from the pop-up menu (see graphic on the
right).
We can do this rather easily at this stage of the process. First, make sure the “Select”
(arrow) icon is selected on the Form Controls vertical toolbar (see graphic to right)
Note: If you click on an empty area of the form, the popup menu will
be different and the “Control Properties...” option will not be
available. Additionally the green boxes will disappear. If this occurs,
go back and click on the “Select” icon and highlight the text box area
as before.
48 | P a g e
The Multiselection dialog box will appear. There are
two items we want to adjust here. First, in the “Height”
entry (which should be blank), enter “0.20” (without
quotation marks). This will reduce the height of the text
boxes. Secondly, change the “Background color” from
“Default” to “White”. Your dialog box should appear as
in the figure to the right (outlined in red).
If you have moved the data fields around or resized any of the fields, you may have also noticed
that when you click on a data field, both the data field and the label are selected, and the label
49 | P a g e
moves and resizes with the data field. To prevent both the label and the data field from being
selected, hold down the control (CTRL) key on your keyboard when you click on the data field
or the label. You will notice that whichever one you clicked on is the only one that is highlighted
with the small blue boxes.
Cleaning Up Labels
To begin cleaning up the labels, first use the CTRL and click combination to highlight the label,
then right click on the label to bring up the menu
options. Select the “Control Properties...” option to
bring up the labels Properties dialog box.
The name and the label text both get their name
from one used in the Members table. Start near the
top of the Properties box. The “Name” entry is the
name of the label and is used to reference labels,
text boxes and other controls when we start to add
programming to our database. The “Label”
information is what the user will see over top of the
data field. You may need to clean these entries up
by removing some letters or adding spaces. If
necessary you can add information to the label to
help clarify the data field.
I would recommend that you continue to use the prefix “lbl” in front of the label name. If you
use a text box I would recommend the prefix “txt”. In this form I would also get rid of “member”
in each label name. You will need to do this for all of the labels. You should also update all the
labels at this time.
50 | P a g e
the right. Click on the down arrow to see all of the formatting options. From
this selection, click on “YYYY-MM-DD” to display the four-digit year.
Once that is done, we want to scroll down until we come across the option
“Dropdown”. Dropdown in this case refers to the dropdown calendar that
can be displayed. There are a number of users that prefer to use the calendar
as the method to input dates instead of entering numbers. Click on the down
arrow and change the default “No” entry to “Yes.” Complete the same
changes for all of the four date data fields.
Next we need to tell the control where to get the data to use in
the listbox. Click on the Data tab, then scroll down to “Type
of list contents” which should have the default value of
“Valuelist”. Change this to “SQL.”
51 | P a g e
When you click on the command button it brings
up the SQL Query Design screen. This design
screen makes it simple to develop queries that
can get information from the database, without
having to learn the SQL language. Begin by
clicking on the “Tables” option button (1), select
the table “lkupMemberStatus” (2) then click on
the “Add” button (3). The table will appear at the
top of the query design screen (4). As this is the
only table we need for this list box, click “Close”
(5) to close out the “Add Table or Query” box.
Begin by selecting one of the telephone number boxes using CTRL-click. Now right click and
from the pop-up menu select “Replace with” followed by “Pattern Field” as we did earlier with
the list box. The Pattern Field is a control that allows you to setup preformatted fields and restrict
the types of input within the field. In this case, we will set up a visual indicator of what the phone
number should look like, as well as restrict the input to only numbers.
Select the Primary Phone Number box, right click and select “Control Properties...” You will
notice that the Properties box now indicates that txtPhonePrimary is now a pattern field.
52 | P a g e
There are two items we need to change in the
properties dialog box; the “Edit Mask” and the
“Literal Mask” fields. The Literal Mask is a
representation of what the user will see in the form,
to help them complete the form properly. The Edit
Mask is where we can limit the types of characters
that the user can input. We will start with the
Literal Mask.
We will use the formatting that starts with the parenthesis around the area code. In the literal
mask option on the properties dialog box enter a left parenthesis, three underscore characters, a
right parenthesis, a space, three underscore characters, a hypen, and finally four underscore
characters. It should look like this (___) ___-____ (see second red circle highlighted above).
Next we will set up the Edit Mask. The edit mask uses certain letters to represent specific types
of characters.1 With our phone number example we will only need to use two characters, the
letter “L” (which represents the symbol in the literal mask) and the letter “N” (which represents
the numbers 0-9).
Our first character in the literal mask is a left parenthesis and we want to keep that as is, so our
first entry in the edit mask is “L”. The next three characters are the numbers of the area code. We
want to replace the underscore characters in the literal mask with these first three numbers. Add
the letter “N” three times after the “L” to represent the three numbers. Next is a right parenthesis
that we wish to keep, so we enter another “L”. At this stage our edit mask should look like this:
LNNNL
Continuing on, the next character in the phone number is a blank space, so we add another “L”.
This is followed by the first three numbers of the phone number so add three more “N”. We now
have a hypen, so time for another “L” and then four more numbers which means four more “N”
characters. So the second half of our edit mask should appear as LNNNLNNNN. If we place the
first half with the second half, you should have the following (we have placed the literal mask
above the edit mask so you can see how each lines up with the other):
(___) ___-____
LNNNLLNNNLNNNN
1 In Appendix 1 we have included the Edit Mask Key which includes all of the special characters and what they
represent.
53 | P a g e
Your properties dialog box should now have both the edit mask and the literal mask filled in (see
graphic above with first two fields highlighted in the red circle).
To complete this formatting, we need to change the field “Strict Format” from “No” to “Yes”
(see graphic above with the third field highlighted in the red circle). The Strict format function
checks the data entry for compliance. Once the strict format function is activated (set to “Yes”),
only the allowed characters are accepted. Continuing to use our phone example, only numbers
are accepted when Strict format is set to Yes.
With the primary phone number completed, do the same thing for the secondary phone data
field. Don’t forget to save your work.
Form Title
We need to add a title to our form so users will know what form they are working on. Go
to the side toolbar and click on the “Label” icon (see the red circled icon in the figure to
the right). Your cursor will change to a cross with a small square in the lower right – much
the same as the group tool. Place the cursor where you want the label to be located, left
click and hold the mouse button down and draw the mouse down and to the right.
Activation Order
If you were to put your cursor on the form and begin hitting the tab key
on the keyboard, you would likely find that the cursor jumps around the
form. We can use the “Activation Order” tool to arrange the tab order in a
way that makes sense to the user. The toolbar button is located at the
bottom of the Form Design toolbar and is circled in red in figure to the right.
54 | P a g e
Start by clicking on the “Automatic Sort” button. This
will perform a quick sort of all of the controls on the
form, sorting them first as you go across the form from
left to right, and then secondly from top to bottom. This
will likely put most of the items in a workable order,
but there may be some controls that don’t make sense
in this sort. For example, you will notice that “Address
1” is followed by “Photo” but instead you want the tab
to go to “Address 2.” To accomplish this, click on
“Photo” and then click on “Move Down” button until it
is located under “Secondary Phone”. Review the listing and move any other controls that are out
of order. When you have all of the controls in the order you want them, click the “OK” button.
Additional Forms
You have now completed the Project Member’s form. Using the same procedures that we just
used above, you can create the additional forms needed for your database. Make sure you include
all of the fields that you need, give them proper names (including prefixes) and check the tab
order when the form is almost done. Don’t forget to save your work as you go along.
The Form Wizard now wants to know if we want to set up a subform. The Members form didn’t
need one, but our Projects form does. We want to add a subform that will display the objectives
of the project.
55 | P a g e
The next screen that appears will ask what fields we
want in the subform. In this case there are only two
fields that we need:
• The objective
• The priority of the objective
The next screen will ask if we want to display all of the data. Like with the Member’s form, we
will leave the default selection with none of the boxes checked. The next screen asked for the
style. Again, this is exactly like the Member’s form.
The final screen wants a name for the form, and we entered “frmProject.” We also selected that
we wanted to modify the form. With this, we clicked on the “Finish” button.
Objectives
The top part of the screen will appear much like the Members form when we first created it.
These fields should be formatted in the same way that we did the fields in the Members form.
The bottom half of the form contains the Objectives grid, and that is what we will focus on in
this section.
56 | P a g e
Now let’s open up the Projects form
and you will see that the grid
displays the auto generated value
for the priority number in the first
column, while the objective text is
in the second column. We want to
change this to something that is
easier for the user to understand.
In the past when we wanted to adjust the properties of a control we would right click on that
control and then select “Control Properties…” from the pop-up menu. However, doing that in the
grid brings up the properties of the grid and not the list box in the first column. When working
with a grid we need to change our method to access the column properties.
When the Query Builder opens, this time select the table
“lkupPriorities” from the list. Drag the field “Priority” into the first
column. Then drag the field “ID_Priority” into the second column. In
column 1 under “Priority” change the “Sort” option to “ascending”.
Also make sure both columns are listed as visible (see graphic to the
right). Make sure you save your work as you go through the process.
57 | P a g e
Now the user will see the priority text in the first column. When they click on the column, a drop
down list of all of the priorities will be available for them to select.
Task Form
The Task form is used to assign project team members to a specific task for the project. This
form is created like the other forms in the database. There is one thing that is different in the
Task form that is not in any of the other forms, and that is the drop-down list box that provides
the members names. This is similar to our other drop-down lists that we have done in our other
forms. What makes this list different is how the member’s names are displayed. The list box only
displays one column, so we can’t list the member’s first, middle and last names in separate
columns and have all three name parts appear in the list box. We could use just the member’s last
name but if you have two members with the same last name you wouldn’t know which one was
being selected. To solve this issue, we use a technique called “concatenation.”
Concatenation is the process of linking several things together into a single item. Here we want
to display the member’s full name in the single column in the list box. We need to link the first,
middle and last name so it appears to the list box as one single name. In our example, we will
have the name displayed as “Last, First Middle” or “Sheppard, Alan Bartlett”.
We need to look at how we want the name to appear so that we can format it properly in the list
box. First, we start with the member’s last name. This is followed by a comma and then a blank
space. Next is the member’s first name, then another blank space and finally the middle name.
We must take into account the blank spaces and the comma as we concatenate the member’s
name.
LibreOffice Base uses two pipe characters (||) to indicate that different fields are going to be
linked together. We can start by adding the field names and the pipe characters to put together
the single name:
If we run the database we will see we get the result of “SheppardAlanBartlett”. A good start, but
not what our users really want to see. We need to add the comma and blank spaces between
names. We do this by starting with a single quote, then add the characters we need, and ending
with a single quote. Since we are concatenating this to our existing fields, we need to use the
pipe characters again. Now we have:
Running this produces the result of “Sheppard, Alan Bartlett” that we want displayed in our list
box. Now we need to add this to our list box.
As we have done before, begin by right clicking on the Assigned Member’s list box and
selecting “Control Properties...” from the popup menu. This will bring up the list box properties
dialog box. Click on the data tab. In the “Type of list contents” change the value to “Sql”. A
command button will appear at alongside the “List content” property. Click on the button.
58 | P a g e
This will bring up the SQL Query Design
tool we have used before. Add the table
“tblMembers” to the tool. In the first
column we are going to add our
concatenation string that we developed
above and place it into the ‘Field’ row.
The next row is labeled “Alias” and here
we enter “FullName”. We want to make
sure that the “Visible” box is checked. In
the second column, drag the field
“ID_Members” into the Field row.
“tblMembers” should appear in the Table
row and the “Visible” box should be
checked (see graphic to the right). Click on the “Save” icon and exit out of this tool.
59 | P a g e
06
Thoughts on Improving
the Rocketry
Research Assistant
If you have followed along from the beginning, you now have a working database that provides
some basic functionality. However, that doesn’t mean that the RRA can’t be improved. This
version of the RRA should be considered just the beginning, a foundation to build upon. Let’s
take a look at some of the changes, updates and improvements that can be made to the system.
Reports
Reports are a common item in just about any database. In this early version of our database we
haven’t added them in yet. You do not need to wait for us to create the reports, however. You
can create your own reports using the built in reporting tool in LibreOffice Base.
Additional Forms
As we noted earlier, this is just the beginning of the database. There are a lot more things that we
can add over time. Some of the items that we can look at adding are:
• A checklist tool
• Launch record/log
• Construction log
• Maintenance log
• Background research
• Materials log
• 3D printing log
This is just a small example of things that can be added. Think about your projects and what you
need to track. Then look at creating the tables and forms to meet that need.
Another area that you might consider is social media. Should we have data fields for a Project
web page, Facebook page or Twitter handle? Are you creating a blog or video journal on
60 | P a g e
YouTube? Is there enough commonality between the various services that you can create a single
table that lists all of these organizations/services?
Error Correction
We currently have a working database and haven’t written a single line of code. Not bad.
However, that doesn’t mean our database can’t be improved by adding in code. We may want to
look at adding code that checks the data the user has entered to make sure it makes sense.
Another area is the display of error messages when something goes wrong. These and other code
additions can go a long way to make the database more user friendly and professional
Database Engine
The current version of the RRA uses the built-in HSQLDB database engine. However, we are
not restricted to that single database engine. LibreOffice Base also offers the use of the Firebird
database engine as an embedded database.
Help File
While this Project Manual will certainly help you create the Rocketry Research Assistant, it
really doesn’t tell you how to use the Assistant. If you are the developer of the software, you start
with a good idea of how you want the software to work, and as you develop the program you are
using it. This means you know how to use the software and what to expect. But what about the
person who simply just wants to use the software? They don’t have the insight the developer has,
they need guidance in how to use the software. What forms are used and where are they located?
How do they perform certain tasks? What if I run into a problem?
All of these issues can be assisted through the use of a User’s Manual and/or a Help File. There
are a number of options that can be used. Some software projects will use a written manual
similar to this Project Manual. Another option is to create a Help file. This can be in the form of
a web site that is stored on the user’s computer or on the programmer's web site. Another option
is the creation of a Wiki that is accessed through the web site.
Some programmers go to great lengths to help their users. Some create short videos that act as
tutorials on how to perform certain tasks. These take you step-by-step through the process. Some
create videos that provide overviews of the software, often much like ‘advertisements’ about the
software.
61 | P a g e
07
Conclusion
This brings to a close Part 1 of our software development series on the Rocketry Research
Assistant. We hope that you found the manual helpful in creating the very beginnings of the
RRA and has you wanting to do even more.
As we move forward with this project we will continue to release a new project manual with
each software release. As is our practice we will explain how we develop the software and how
you can recreate the database. For those that simply want a working database, we will continue
to post updates to SourceForge.
Thanks to the technology available to us today, there is just so much that rocketeers of all ages
can accomplish with model rocketry. Rocketry research has made use of databases for a long
time. The ability to create your own database to better meet the needs of your projects is a great
skill to have. It is not the only thing that has entered the hobby of model rocketry in recent years,
however.
The addition of small, single board computers and microcontrollers has added a new dimension
to what you can do with a model rocket. The aspect of 3D printing and readily available CAD
programs allow you to design the supporting hardware needed for your project. It is indeed an
exciting time for rocketeers of all ages.
We hope that you found this Program Manual useful, and that it helps spur new ideas for new
projects in model rocketry.
62 | P a g e
Appendix
63 | P a g e
A1
LibreOffice Base Edit
Mask Key
The following keys can be used when setting up a Pattern control for data input.
Strict Format
For control fields that accept formatted contents (date, time, etc) you can use the Strict format
function to check the data entry for compliance. If the strict format function is activated (set to
“Yes”), only the allowed characters are accepted. Continuing to use our phone example, only
numbers are accepted when Strict format is set to Yes. All alphabet or symbol entries are
ignored.
Key Function
a Mixed case letters (a-z and A-Z)
A Upper case letters. Lower case letters will be converted to upper case (A-Z)
c Mixed case letters and numbers (a-z, A-Z and 0-9)
Upper case letters and numbers. Lower case letters will be converted to upper case(A-Z and
C
0-9)
L This position cannot be edited. It will display the literal mask value
N Numbers only. Letters and symbols will be ignored (0-9)
All printable characters can be entered. This includes upper and lower case letters, numbers
x
and symbols
All printable characters can be entered, but lower case letters will be converted to upper case.
X
Numbers and symbols can also be entered
64 | P a g e
A2
Tables
tblMembers (Team Members Table)
Key Field Name Type Length Required
ID_Members INTEGER (Auto)
memberNamePrefix VARCHAR (Text) 10
memberNameFirst VARCHAR (Text) 50
memberNameMiddle VARCHAR (Text) 50
memberNameLast VARCHAR (Text) 50
memberNameSuffix VARCHAR (Text) 10
memberAddress1 VARCHAR (Text) 100
memberAddress2 VARCHAR (Text) 100
memberCity VARCHAR (Text) 50
memberStateID INTEGER (Link)
memberZip VARCHAR (Text) 10
memberEmail VARCHAR (Text) 150
memberPhonePrimary VARCHAR (Text) 12
memberPhoneSecondary VARCHAR (Text) 12
memberDateBirth DATE
memberDateJoined DATE
memberStatusID INTEGER (Link)
memberProjectLeadQualified BOOLEAN (Y/N)
memberDateSeparated DATE
memberHPRCertification BOOLEAN (Y/N)
memberHPRCertificationLevel TINYINT (1, 2, or 3) 3
memberNotes LONGVARCHAR (Text)
memberPhoto LONGVARBINARY (Image)
65 | P a g e
tblProjects (Project Table)
Key Field Name Type Length Required
ID_Project INTEGER (Auto)
projectName VARCHAR (Text) 100
projectTypeID INTEGER (Link)
projectOverview VARCHAR (Text) 8000
projectPriorityID INTEGER (Link)
projectLeadMemberID INTEGER (Link)
projectDateStart DATE
projectDateDue DATE
projectStatusID INTEGER (Link)
projectCompletionPercentage TINYINT (0-100)
projectDateEnd DATE
projectNotes LONGVARCHAR (Text)
projectLogo LONGVARBINARY (Image)
66 | P a g e
tblObjectives (Objectives Table)
Key Field Name Type Length Required
ID_Objective INTEGER (Auto)
objProjectID INTEGER (link)
objObjective VARCHAR (Text) 300
objPriorityID INTEGER (link)
67 | P a g e
lkupStates (States Table)
Key Field Name Type Length Required
ID_States INTEGER (Auto)
stateName VARCHAR (Text) 75
stateAbbreviation CHAR (Text) 2
68 | P a g e
A3
Relationships
The following shows the relationships that are used in the Rocketry Research Assistant.
69 | P a g e
A4
Relationship Graph
Relationships for Version 0.1.0 of the RRA database
70 | P a g e
A5
Sample Forms
71 | P a g e
Project Members form – Dark Theme
72 | P a g e
Tasks form – Light Theme
73 | P a g e
A6
Data Types for the
Table Editor*
Table 1: Integer data types
74 | P a g e
Table 4: Date and time data types
In the table definitions, and when data types are changed in queries using the “convert” or “cast”
functions, some data types expect information about the number of characters (a), the precision
(g, corresponding to the total number of characters) and the number of decimal places (d). The
types are CHAR(a), VARCHAR(a), DOUBLE(g), NUMERIC(g, d), DECIMAL(g, d) and
TIMESTAMP(g).
TIMESTAMP(g) can have only two values: ‘0’ and ‘6’. ‘0’ means that no seconds will be stored
in the decimal part (tenths, hundredths...). The precision of timestamps can be given only directly
using SQL commands. So if you are storing timings from some kind of sport, you must set
TIMESTAMP(6) using Tools > SQL in advance.
* From LibreOffice Base Guide 7.3, Appendix A “Common Database Tasks” Page 521
Permission: Creative Commons Attribution License
(https://creativecommons.org/licenses/by/4.0/), version 4.0 or later.
75 | P a g e
A7
Properties of Controls ‡
76 | P a g e
Interaction
Control Use
Button Button with label
Image button Like a button, but with an additional image (graphic) displayed
on it
Navigation bar Toolbar very similar to the one at the bottom edge of the screen
File selector For selecting files, for example to upload in an HTML form—
not further described
Spin box Can only be used with a macro—not further described
Scrollbar Can only be used with a macro—not further described
Hidden control Here a value can be stored using macros and then read out
again,
‡
From LibreOffice Base Guide 7.3, Chapter 4 “Forms” Page 175
Permission: Creative Commons Attribution License
(https://creativecommons.org/licenses/by/4.0/), version 4.0 or later.
77 | P a g e
A8
References
LibreOffice Base Guide 7.3
https://nextcloud.documentfoundation.org/s/qjFkGwpEEkNrt6f
78 | P a g e
If You Enjoy Rocketry,
Consider Joining the NAR
If you enjoy model rocketry and projects such as the Arduino Launch Control System, then
consider joining the National Association of Rocketry (NAR). The NAR is all about having fun
and learning more with and about model rockets. It is the oldest and largest sport rocketry
organization in the world. Since 1957, over 80,000 serious sport rocket modelers have joined the
NAR to take advantage of the fun and excitement of organized rocketry.
79 | P a g e