Microsoft KB Archive/225422

= ACC97: Outer Join Returns Wrong Records with ODBC Tables vs. Local Tables =

Article ID: 225422

Article Last Modified on 1/24/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q225422





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



SYMPTOMS
You may get different results running a query that contains a WHERE clause and an outer join to another query on a local table than you get on an linked ODBC table. This happens even though the local table and the linked table contain the same data.



CAUSE
When the tables are local, the WHERE clause is processed before the outer join. However, when the tables are linked, the queries are combined into a single SQL statement and the WHERE clause is processed after the outer join.



RESOLUTION
To prevent this problem, the version of Microsoft Jet must be 3.51.2723.0 or later. To obtain a new version of Jet, install Microsoft Jet 3.51 Service Pack 2.



STATUS
This problem was corrected in Microsoft Jet 3.51 Service Pack 2.



MORE INFORMATION
For additional information about Microsoft Jet 3.51 Service Pack 2, please see the following article in the Microsoft Knowledge Base:

172733 Updated Version of Microsoft Jet 3.5 Available for Download

Steps to Reproduce Behavior
  Create a new database with the following tables and queries:   Table: Table1 -  Field Name: a   Data Type: Number

Field Name: b  Data Type: Text

Table: Table2 -  Field Name: a   Data Type: Number

Field Name: c  Data Type: Text

Query: Query1 -  Field: a   Table: Table2

Field: c  Table: Table2 Criteria: "x"

Query: Query2 --  Join: Table1.[a] -> Query1.[a]

Field: a  Table: Table1

Field: b  Table: Table1

Field: c  Table: Query1   Add the following records to Table1:   a     b   --- 1    a   2     b   3     c                       Add the following records to Table2: <pre class="fixed_text">  a     b   --- 1    x   2     y   3     z                     </li> Select Query2, and then click Open.

Note that there are three records.</li> Export Table1 and Table2 to a SQL Server.</li> In the Access database, rename Table1 and Table2 to Table1_local and Table2_local, respectively.</li> Create a link to Table1 and Table2 on the SQL Server. You do not need to select a unique record identifier.</li> Rename the linked tables to Table1 and Table2.</li> Select Query2, and then click Open.

Note that there is only one record.</li></ol>

Additional query words: pra link attach attached

Keywords: kbbug kbfix KB225422

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.