Join tables from different databases

Results 1 to 2 of 2

Thread: Join tables from different databases

  1. #1
    Join Date
    Dec 1969

    Default Join tables from different databases

    I&#039;m trying to join multiple tables from multiple databases and show results in a datagrid. I have 5 inventory databases, the tables in each database are the same (same name and fields), but the data is different. I am trying to query all database tables and show all data in one grid. Is this possible, and if so how?<BR><BR>I&#039;m using MSAccess, once i have the dataset I can populate the grid.<BR><BR>TIA

  2. #2
    Join Date
    Dec 1969

    Default RE: Join tables from different databases

    This would not be joining the tables, it would be unioning them. In Access you could make link tables to the other Access databases and make a query that unions all the results. I tried this a while back and after some headaches got it to work (I think) but it took work. I seem to remember something about having trouble using the link tables when connecting from ASP using ADO. With .NET this may be different.<BR><BR>The other option would be to run 5 queries, 1 against each database table getting back 5 datasets. Then in your code add all the rows together into a new DataTable, and then set sorting appropriately.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts