ACC2: Table and Query Questions and Answers

ID: Q114810


The information in this article applies to:

Novice: Requires knowledge of the user interface on single-user computers.

SUMMARY

This article contains questions and answers about Microsoft Access version 2.0 tables and queries.


MORE INFORMATION

  1. Q. How have queries changed in Microsoft Access version 2.0?

    A. Queries are now more flexible and are easier to create. The new QueryWizards--Crosstab, Find Duplicates, Find Unmatched, and Archive--help you quickly create complex queries for managing your data.

    There are also three new SQL-specific queries. These are union queries, data-definition queries (queries that create, change, or delete tables and indexes in Microsoft Access databases), and SQL pass-through queries (queries that pass SQL statements directly to a SQL database, providing improved connectivity in client-server relationships).

    In addition, improvements in updating in multiple-table queries and the addition of TopValues queries and subqueries give you greater query functionality.


  2. Q. When I add two tables to my query that do not have a defined relationship, Microsoft Access automatically joins them. Can I prevent this from happening?

    A. Microsoft Access 2.0 automatically joins two tables in a query if the tables meet the following criteria:


    Only one AutoJoin is automatically created between two tables. Even if there is more than one join possible between the two tables, a join is created only between the first fields that meet the above criteria. If you add three tables that meet the above criteria to a query, three joins are created--one for each table pair.

    You cannot turn this functionality off. You must either delete the join line after it is created or manually define a relationship between the two tables.


  3. Q. How does the new Relationships window work? What does it mean when I am prompted to save the layout?

    A. The new Relationships window gives you a graphical display of the tables in your database and their relationships to each other. You can customize the Relationships window and view as many or as few tables as you want. You can also create or change table relationships in this view. For more details about the Relationships window, order the fax or mail copy of this script.



  4. Q. Why can I update more fields in my query than I could in Microsoft Access version 1.x?

    A. In Microsoft Access 2.0, when a query includes fields from more than one related table, you can update data on both sides of the join. This means that in a query that combines data from two tables, you can update data from both of the tables in the query.

    If you want to prevent users from updating fields in a multiple- table query, create a form based on the query and then set the Locked property for the fields you do not want users to update.

    For more information about updating queries, search for "queries: updating underlying tables" and then view both of the related topics using the Microsoft Access Help menu.


  5. Q. How have validation rules and default values changed?

    A. In Microsoft Access 2.0, validation rules are always enforced, no matter how you add or edit data. Because default values and validation rules are always enforced, the following items are not valid in default values or field-level validation rules:



  6. Q. Why can't I set referential integrity?

    A. Referential integrity is a set of rules that preserves the defined relationships between tables when you enter or delete records. If you enforce referential integrity, you cannot add a record to a related table when there is no associated record in the primary table, change a value in a primary table that would result in an orphan record in a related table, or delete a record from a primary table when there is a matching related record.

    If you select the Cascade Update Related Fields or Cascade Delete Related Records option for a relationship, Microsoft Access will change or delete related records to ensure that the referential integrity rules are enforced when you change or delete records.

    There are several possible reasons why you can't enforce referential integrity when you are defining a relationship. For additional information, you can order item number Q112111 by selecting the FastTips Technical Library option from the FastTips Main Menu.


  7. Q. How can I optimize my queries?

    A. Microsoft Access 2.0 uses Rushmore, a data-access technology that permits sets of records to be queried very efficiently. Here is a summary of query performance tips:


    For more information about query performance, search for "Rushmore technology" then "Optimizing Queries with Rushmore Technology" using the Microsoft Access Help menu. Or, you can order item number Q112112 by selecting the FastTips Technical Library option from the FastTips Main Menu.


  8. Q. Why do I see a number instead of "(counter)" for my counter field?

    A. Microsoft Access 2.0 enters a counter value when you start to edit a new record. In Microsoft Access 1.x, this value was entered after you saved the record.

    Since this value is now provided earlier, if you start editing a new record and then cancel the record, the counter value is still used, even though no record is stored with the value. For example, when you add a new record to a table containing two records, the counter value is 3. If you cancel this new record and then later add another new record, the counter value is 4 for the new record.

    Counter values are not reused when you delete records. For example, if in a table of 15 records you delete the last three records and then add a new record, the counter value for the new record is 16. To reset the next available counter value, compact the database. After the database is compacted, the next available counter is set to one higher than the last counter value in the table.

    For additional information about counters, you can order item number Q112160 by selecting the FastTips Technical Library option from the FastTips Main Menu.


  9. Q. While I was creating a query, when I switched from a Select query to a SQL Specific query, the SQL statement disappeared. When I switched back to a Select query, my query disappeared. Where did my query go?

    A. When you switch to a SQL Specific query, the SQL statement from the existing query is deleted. If you want to start with a Select query to help create the SQL statement for a SQL Specific query (to save some typing) use the following six steps:

    1. Create the Select query.


    2. From the View menu, choose SQL.


    3. Select the entire SQL statement, except for the ending semicolon.


    4. Copy the selected text to the Clipboard by pressing CTRL+C, or by choosing Copy from the Edit menu.


    5. From the Query menu, choose SQL Specific, then choose a query type.


    6. Paste the query text into the Query window by pressing CTRL+V, or by choosing Paste from the Edit menu.




  10. Q. How do I remove the underline characters in my input masks?

    A. An input mask consists of up to three parts, separated by semicolons. The first part specifies the input mask itself, the second part specifies whether Microsoft Access stores the literal display characters in the table when you enter data, and the third part specifies the character that Microsoft Access displays in the input mask for spaces.

    If you omit the third part, Microsoft Access uses an underline character for the input mask. For example, in the Customers table in the sample database NWIND.MDB, the input mask on the Customer ID field is:
    
              >LLLLL 

    When you enter data in a new record, five underlines are displayed in the field. You can replace these underlines with spaces by using the following for the input mask:
    
              >LLLLL;;" " 

    For more information about input masks, search for "input mask" then "Adding an Input Mask" using the Microsoft Access Help menu.



Keywords          : kbdta 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: April 2, 1999