Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Access database
1. Access Databases
Microsoft Access databases contain seven main kinds of objects. These are all stored
together in one file (.mdb). The most important type of object is the Table, because that’s
where the data are stored. Queries and Forms are indispensable tools for viewing and
editing data. Reports work great for creating hard copies of data. You are less likely to
use Pages, Macros, or Modules.
One thing to remember when using Access databases is that you need to run Compact
and Repair Database (under the Tools and then the Database Utilities menu) on a regular
basis. This is especially important after deleting, adding, or editing large amounts of
data.
Tables
· Contain all of the actual data in the database
· Can be edited directly, although it’s usually better to create forms for editing data
· Tables should be normalized
· Relationships between tables can be defined for the database
· An index helps speed up searching on a particular field (but may slow down data
editing)
Queries
· Just SQL (structured query language) statements to extract or manipulate data
from one or more tables
· Access has a graphical interface so you don’t have to worry about the underlying
SQL
· No data is actually stored in a query
· Most queries are Select queries – as you might guess, they are used to select out
certain bits of data from the underlying tables
· Special kinds of queries can also be used to update, append, and delete data from
tables, as well as create new tables
· You have access to more kinds of query wizards if you use the New button at the
top of the Database window, rather than clicking on “Create query by using
2. wizard”. These will help you make queries that are more complicated than a
standard Select query.
3. Forms
· Just graphical interfaces to view or edit information in one or more tables
· No data is actually stored in a form
· Usually safer to edit data with a well-designed form than directly in the table
o Can view and edit multiple tables at once, so you know that relationships
are correct
o Can be set up to only allow certain types of data
o Can have underlying VBA code to do custom tasks while data is being
added
· Can also be used for all kinds of other things, if you can write the underlying
VBA code
Reports
· Used to display data from one or more tables
· Can also include summary statistics
· The same data can be displayed in different ways by different reports
· No data is actually stored in a report
Pages
· Short for Data Access Pages
· Web page that connects directly to your database
Macros
· Short bits of code to do simple, repetitive things
· Some actions built in to Macro Editor so you can easily create a macro to do those
things
· Can use macros to launch code stored in Modules