Query a table in a seperate Database

  • Hello,


    I need to run a query on a table that is in a seperate database. I know I can use code to query a table in the current database but I like to prevent importing the table if at all possible. I know how to build the SQL statements for the query, I just don't know how to tell it to query the table in a seperate database.


    Any help is appreciated.

  • Re: Query a table in a seperate Database


    How about creating an ADODB link first...



    This is a only a very basic solution, but one that's helped me quite a bit. Hope it helps you.


    Cheers


    :)


    Eljays

  • Re: Query a table in a seperate Database


    You can also use a query such as;


    SQL
    1. SELECT * FROM [C:\DOR_DB\DOR].DTR_Files


    Within the Brackets you enter the path of the database then just the name of the database and close the brackets. You then append as you see above the table name you wish to query.