Microsoft Knowledge Base Email Alertz

(244125) - When you run a SQL query containing more than 22 UNION statements using Microsoft Jet 4.0 the following error appears: Not a valid alias name. The same query worked without error when using Microsoft Jet 3.x.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 244125 - Last Review: April 7, 2006 - Revision: 4.1

FIX: Acc2000: "Not a Valid Alias" Jet 3068 Error Message

This article was previously published under Q244125

On This Page

SYMPTOMS

When you run a SQL query containing more than 22 UNION statements using Microsoft Jet 4.0 the following error appears:
Not a valid alias name.
The same query worked without error when using Microsoft Jet 3.x.

CAUSE

This problem is caused by a bug in the underlying Microsoft Jet 4.0 database engine that is included with the Microsoft Data Access Components (MDAC) versions noted in the earlier. As a result of this bug Microsoft Jet 4.0 is unable to execute queries containing more than 22 UNION statements.

RESOLUTION

To resolve this problem, download and install the latest Jet 4.0 service pack. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
239114  (http://kbalertz.com/Feedback.aspx?kbNumber=239114/ ) How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine

STATUS

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

Note The Microsoft Jet Engine does not ship with MDAC 2.6.

This problem was corrected in Jet 4.0 SP 5.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Install MDAC 2.1 SP2 on a test computer.
  2. Create an ODBC DSN to the NorthWind.mdb sample database called NorthWind.
  3. Run the following VBA code. NOTE: The VBA project requires a reference to the "Microsoft ActiveX Data Objects 2.1 Library.":
    Sub TestUNIONError()
    Dim conn As New ADODB.Connection
    Dim sql As String
    Dim i As Long
    
        conn.Open "NorthWind"
        For i = 1 To 22
            sql = sql & "select * from shippers UNION "
        Next i
        sql = sql & "select * from shippers"
        conn.Execute sql
        conn.Close
    
    End Sub
    					
  4. Run the application. It results in the following error message:
    Run-time error '-2147467259 (80004005)'.
    [Microsoft][ODBC Microsoft Access Driver] Not a valid alias name.

APPLIES TO
  • Microsoft Data Access Components 2.1 Service Pack 2
  • Microsoft Data Access Components 2.5
  • Microsoft Open Database Connectivity Driver for Access 4.0
  • Microsoft OLE DB Provider for Jet 4.0
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbqfe kbhotfixserver kbbug kbdatabase kbfix kbjet KB244125
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate