Microsoft KB Archive/319389

= PRB: The Query Builder Does Not Display All Relations in an Access Database If You Add Tables in Groups =

Article ID: 319389

Article Last Modified on 6/3/2002

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Enterprise Architect

-



This article was previously published under Q319389



SYMPTOMS
If you add tables from a Microsoft Access database in groups in the Visual Studio .NET Query Builder, some relationships may be omitted. If you delete and re-add the table that is missing its foreign-key relationship, the relationship appears as expected.



RESOLUTION
To resolve this behavior, delete and add the table that is missing its foreign-key relationship individually from the other tables.



Steps to Reproduce the Behavior
 Start a new Windows Application project in any language in Visual Studio .NET. Drag an OleDbDataAdapter from the toolbox to the form. The Data Adapter Configuration Wizard appears. Click Next. Click New Connection. On the Provider tab, click Microsoft Jet 4.0 OLE DB Provider. Click Next.</li> Enter the name and path to your copy of the Northwind.mdb database.</li> Click OK, and then click Next.</li> Accept the default option, and then click Next.</li> Click Query Builder.</li> Select all of the tables from the Northwind database in the list of tables, and then click Add.</li> Click Close.</li>  Expand the Query Builder window so that you can see all the tables that you just added. The Northwind database contains the following seven foreign-key relationships defined between its tables <pre class="fixed_text">Products.CategoryID = Categories.CategoryID Products.SupplierID = Suppliers.SupplierID Orders.CustomerID = Customers.CustomerID Orders.EmployeeID = Employees.EmployeeID Orders.OrderID = OrderDetails.OrderID Orders.ShipVia = Shippers.ShipperID [Order Details].ProductID = Products.ProductID but only the following three foreign-key relationships appear: <pre class="fixed_text">[Order Details].ProductID = Products.ProductID Products.SupplierID = Suppliers.SupplierID Orders.CustomerID = Customers.CustomerID </li> To restore the missing relationship between the Categories and Product tables, click the existing Categories table, and then click Delete.</li> Right-click in the database diagram window, and then click Add Table....</li> Click the Categories table in the list, and then click Add. The relationship between the Categories and Products tables appears in the diagram.</li> Repeat this procedure to restore the other missing foreign-key relationships to the diagram.</li></ol>

Additional query words: &quot;Query Builder&quot; FK links join

Keywords: kbprb KB319389

-

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

© Microsoft Corporation. All rights reserved.