1
2
Queries give database managers its real power. Their most common function is to filter and consolidate data from tables to retrieve it. The data you want to see is usually spread across several tables and you usually don't want to see all the records at once. Queries get data from different tables, let you add criteria to "filter" it and present the filtered result in a single table. Queries often serve as the record source for forms and reports. Certain queries are "updateable," meaning you can edit the data in the underlying tables via the query datasheet. Queries come in two basic varieties: select queries and action queries. A select query simply retrieves the data and makes it available for use. You can view the results of the query on the screen, print it out, or copy it to the clipboard. Or, you can use the output of the query as the record source for a form or report. An action query, as the name implies, performs a task with the data. Action queries can be used to create new tables, add data to existing tables, update data, or delete data. In most modern database packages you have a graphical tool to make queries, but you can also use a specific language to make them. What the graphical tool does is let you select the tables, fields, relationships and filters and translate it into the query language. 3
Forms are the "data entry screens." They are the interfaces you use to work with your data, and they often contain command buttons that perform various commands. You can create a database without using forms by simply editing your data in the table datasheets. However, most database users prefer to use forms for viewing, entering, and editing data in the tables. Forms provide an easy-to-use format for working with the data, and you can also add functional elements, such as command buttons, to them. You can program the buttons to determine which data appears on the form, open other forms or reports, or perform a variety of other tasks. For example, you might have a form named "Customer Form" in which you work with customer data. The customer form might have a button which opens an order form where you can enter a new order for that customer. Forms also allow you to control how other users interact with the data in the database. For example, you can create a form that shows only certain fields and allows only certain operations to be performed. This helps protect data and ensures that the data is entered properly. 4
Reports are used to summarize and present data in the tables and have options to present the information in the most readable way possible. You can run a report at any time and get the state of the current data in the database. The usual option is to format Reports to be printed out, but they can also be viewed on the screen, exported to another program, or sent as e-mail message. 5
Macros are a simplified programming language which you can use to add functionality to your database. For example, using events associated to controls, you can link a macro to a command button on a form so that the macro runs whenever the button is clicked. Macros perform tasks, such as opening a form, running a query, or closing the database. Most database operations that you do manually can be automated by using macros, so they can be great time-saving devices. In most database packages you can also create more complex programs in a standard programming language to add functionality to your database. These programs are called Modules and can be attached to a specific Report or Form or contain general procedures 6
The different elements of a Form or a Report are called Controls. The Heading of a form, the text label of a field or the text box used to enter the value of a field are all Controls. Forms, Reports and Controls are objects within the database manager package and have properties (width, height, background color, type of content allowed if it is an input control, font type and size, etc..) that can be accessed or modified, either with a graphical interface when configuring forms and reports, or with macros or modules. These objects also have predefined events (for example when someone clicks, when they receive o lose the focus from the app, when the content is modified) that can be assigned to macros or modules to perform complex tasks. 7
You can use a database manager package with its own integrated database or connect it to an external source of data. This external source can be an Excel spreadsheet, another database package or a central database using the client-server model. If you want to use a central database you have to use special drivers that let your package access them. There are drivers for every type of big database such as Oracle, SQL Server or MySQL. In Windows there is a standard system to access these drivers called ODBC. You can also import external data into the database from a spreadsheet, a formatted text file or another source. A typical format for importing and exporting data into text files is called csv (Comma Separated Values). If you link the external data, it stays in its original place and if any change is made the original data is updated. If you import the data into the local database a copy of the data is made and changes take place in this local copy. 8
All of this makes database management packages very powerful and flexible tools that you can use to build personalized applications to fulfill very specific data processing needs. 9
10