Lab%2010%20-%20Microsoft%20Access%20Query%20By%20Example

Lab%2010%20-%20Microsoft%20Access%20Query%20By%20Example -...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
L AB 10 M ICROSOFT A CCESS Q UERY B Y E XAMPLE WHAT IS QBE? Query-By-Example, or QBE, replaces the command-line driven interface of SQL with a graphical user interface. For many kinds of queries, QBE provides a more user-friendly approach to building queries. For simple queries, QBE is often the easier-to-use tool. Yet QBE is less powerful than SQL and, with some kinds of queries, less precise. A skilled Access developer will want to be familiar with both tools HOW TO BUILD QBE QUERIES IN MICROSOFT ACCESS In the menu at the top of the window, click Create. Click on the Query Design icon in the toolbar. At this point when doing SQL, we always closed the Show Table dialog. However, with QBE, the Show Table dialog allows you to choose the table you want to query. In other words, you don't need to remember the exact spelling of the table name as you do with SQL. Instead of closing the Show Table dialog, highlight Products and click Add. Notice that the Show Table dialog does not immediately close. That is so that, optionally, you can add another table. But we will use just the Products table for this query. So click Close. Now you will see the QBE design window. The diagram below shows a fully designed QBE design window with annotations. CNIT 180: Lab 10 – Microsoft Access Query By Example Page 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Let's go about building the query that is shown above. Our first step will be to select the fields to be displayed in the query. There are three ways to add a column to the query: 1. Double-click on the field name in the table list shown at the top of the QBE design window. 2. Drag a field name from the table list into a column in the grid at the bottom of the QBE design window. Note: if you drag a field name into a column that already contains a field name, the previous field name will be shifted to the right. 3. Click into the Field row of a column in the grid at the bottom of the QBE design window. A dropdown arrow will appear. Click on the dropdown arrow and select the appropriate field from the list. Let's add a field to the query using each of these methods. First, double-click on ProductName in the table list at the top of the QBE design window. ProductName should then appear in the first column of the grid at the bottom of the window. Next, use the scroll bar on the table list at the top of the QBE design window to scroll through the list of fields until you see Cost. Drag Cost into the second column of the grid. Finally, click into the Field row of the next open column of the grid. You should see a dropdown arrow appear as shown here. Click on the dropdown arrow and select UnitPrice. CNIT 180: Lab 10 – Microsoft Access Query By Example Page 2
Background image of page 2
T IP What if you accidentally add a column to the grid and want to get rid of it? Just click into any row of the column you want to delete and click the Delete Columns tool in the toolbar.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CNIT 180 taught by Professor Victorbarlow during the Spring '12 term at Purdue University-West Lafayette.

Page1 / 16

Lab%2010%20-%20Microsoft%20Access%20Query%20By%20Example -...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online