Microsoft KB Archive/248271

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Article ID: 248271

Article Last Modified on 6/24/2004



APPLIES TO

  • Microsoft Access 2000 Standard Edition



This article was previously published under Q248271

Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).


SYMPTOMS

When you run certain queries, such as a union query, you may receive the following error message:

Not a valid alias name.

RESOLUTION

Install the latest Microsoft Jet 4.0 service pack. For additional information about installing the latest version of the Jet Update, click the following article number to view the article in the Microsoft Knowledge Base:

239114 How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine


STATUS

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

MORE INFORMATION

There are several possible causes for this error. One example is a union query that has more than 22 Select statements. The following steps illustrate this problem.

Steps to Reproduce the Behavior

  1. Open the sample database, Northwind.mdb.
  2. Create the following union query that contains 22 Select statements:

    SELECT EmployeeID FROM Employees
    UNION ALL
    SELECT LastName FROM Employees
    UNION ALL
    SELECT FirstName FROM Employees
    UNION ALL
    SELECT Title FROM Employees
    UNION ALL
    SELECT TitleOfCourtesy FROM Employees
    UNION ALL
    SELECT BirthDate FROM Employees
    UNION ALL
    SELECT HireDate FROM Employees
    UNION ALL
    SELECT Address FROM Employees
    UNION ALL
    SELECT City FROM Employees
    UNION ALL
    SELECT Region FROM Employees
    UNION ALL
    SELECT PostalCode FROM Employees
    UNION ALL
    SELECT Country FROM Employees
    UNION ALL
    SELECT HomePhone FROM Employees
    UNION ALL
    SELECT Extension FROM Employees
    UNION ALL
    SELECT Photo FROM Employees
    UNION ALL
    SELECT Notes FROM Employees
    UNION ALL
    SELECT ReportsTo FROM Employees
    UNION ALL
    SELECT EmployeeID FROM Employees
    UNION ALL
    SELECT LastName FROM Employees
    UNION ALL
    SELECT FirstName FROM Employees
    UNION ALL
    SELECT Title FROM Employees
    UNION ALL
    SELECT TitleOfCourtesy FROM Employees;
                        
  3. Save and run this query. Note that the query runs without error.
  4. In Design view of this query, remove the semicolon from the end of the statement, and then append the following to the end of the statement:

    UNION ALL
    SELECT BirthDate FROM Employees;
                        
  5. The union query now contains 23 Select statements. Save and run the query. Note that you receive the error message mentioned in the "Symptoms" section of this article.



Additional query words: pra

Keywords: kberrmsg kbbug KB248271