ACC2002: "Column Names in Each View or Function Must Be Unique..." Error Message When You Save a Query in an Access Project (295223)



The information in this article applies to:

  • Microsoft Access 2002

This article was previously published under Q295223
Novice: Requires knowledge of the user interface on single-user computers.

This article applies only to a Microsoft Access project (.adp).

SYMPTOMS

When you create a query that contains two or more tables in a Microsoft Access project (.adp), you receive the following error message when you try to save the query:
ADO error: Column names in each view or function must be unique. Column name 'FieldName' in view or function 'dbo.QueryName' is specified more than once.

CAUSE

An alias is not automaticly generated for the second instance of the field name if you use *(all Columns) for both tables and any field names are the same.

RESOLUTION

In the Add Table dialog box, add each field individually by clicking to select the check box next to the field name.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database NorthwindCS.adp.
  2. In the Database window, click Queries under Objects, and then click New.
  3. In the New Query dialog box, click Design View, and then click OK.
  4. In the Add Table dialog box, click the Orders table, hold down the CTRL key, click the Order Details table, click Add, and then click Close.
  5. Click to select the *(All Columns) check box for both tables.
  6. Save the query as View1. Note that you receive the following error message:
    ADO error: Column names in each view or function must be unique. Column name 'OrderID' in view or function 'dbo.View1' is specified more than once.

Modification Type:MajorLast Reviewed:11/5/2003
Keywords:kbbug KbClientServer kberrmsg KB295223