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



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition

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.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Start a new Windows Application project in any language in Visual Studio .NET.
  2. Drag an OleDbDataAdapter from the toolbox to the form. The Data Adapter Configuration Wizard appears.
  3. Click Next.
  4. Click New Connection.
  5. On the Provider tab, click Microsoft Jet 4.0 OLE DB Provider.
  6. Click Next.
  7. Enter the name and path to your copy of the Northwind.mdb database.
  8. Click OK, and then click Next.
  9. Accept the default option, and then click Next.
  10. Click Query Builder.
  11. Select all of the tables from the Northwind database in the list of tables, and then click Add.
  12. Click Close.
  13. 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
    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:
    [Order Details].ProductID = Products.ProductID
    Products.SupplierID = Suppliers.SupplierID
    Orders.CustomerID = Customers.CustomerID
    					
  14. To restore the missing relationship between the Categories and Product tables, click the existing Categories table, and then click Delete.
  15. Right-click in the database diagram window, and then click Add Table....
  16. Click the Categories table in the list, and then click Add. The relationship between the Categories and Products tables appears in the diagram.
  17. Repeat this procedure to restore the other missing foreign-key relationships to the diagram.

Modification Type:MajorLast Reviewed:6/3/2002
Keywords:kbprb KB319389