The update query is based on a select query. In Microsoft Access 7.0 or
earlier, a select query returns only unique records by default; the SQL
statement that defines the query contains the predicate DISTINCTROW.
However, a select query in Microsoft Access 97 does not contain
DISTINCTROW by default, and all records are returned, even if an entire
record is a duplicate of another record in the query results.
Create a new database called TstUpdt.mdb in Microsoft Access 7.0 or
earlier.
2.
Import the Customers table, the Orders table, and the Order Details
table from the sample database Northwind.mdb (or NWIND.MDB in version
2.0) into the new database.
3.
Create a new query in Design view based on the Customers, Orders, and
Order Details tables.
NOTE: In the following query, [CustomerID], [OrderID], [ContactName],
and [EmployeeID] each contain a space in version 2.0.
Create a new update query in Design view based on the qryOrderInfo
query.
NOTE: In the following query, [ContactName] contains a space in
version 2.0.
Query: qryUpdateOrder
----------------------
Type: Update Query
Field: ContactName
Table: qryOrderInfo
Update To: "XXX"
Field: Quantity
Table: qryOrderInfo
Update To: 33
6.
Run the query. You will see a message indicating the number of rows
that will be updated; click No (or Cancel in version 2.0) to cancel
the update.
7.
Save the qryUpdateOrder query and close the database.
8.
Start Microsoft Access 97 and open TstUpdt.mdb. Convert the database
when prompted.
9.
Run the qryUpdateOrder query. When you receive the alert that you are
about to run an Update query that will modify data in your table,
click Yes. Note that you receive the error message:
Operation must use an updatable query.
To resolve the error, continue with the following steps.
10.
Open the qryUpdateOrder query in Design view.
11.
On the View menu, click SQL View.
12.
Delete the word DISTINCTROW from the query's SQL statement.
13.
On the Query menu, click Run. You will see a message indicating the
number of rows that will be updated; click Yes. Note that the query
runs without errors.
For more information about the DISTINCTROW predicate, search the Help
Index for "UniqueRecords property," or ask the Microsoft Access 97 Office
Assistant.
Need More Help? Contact a Support professional by Email, Online or Phone.
Customer Service For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
Newsgroups Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.