Results 1 to 4 of 4

Thread: create 1 query from two databases

  1. #1

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Question create 1 query from two databases

    with VB6 (ado) + Access03;
    -------------------------
    how can i generate a query using two tables from two different data bases ( one is .mde and another .mdb)

    (1) i opened the connection and recordsets of the both the
    data bases
    (2) confusion from here on wards
    i want to inner join the .mde1 table with .mdb2 table
    and extract some sorted records

    any advice please.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: create 1 query from two databases

    Two different connections are no good - because queries run against just one connection.

    What recordset(s) you have open already are irrelevant, as they cannot be used as the source for more queries.


    There are two ways I can think of to do what you want.

    The first is to open one of the databases and add Linked Tables, which allow you to treat the tables of the other database as if they are in the same database (and you get to choose what to call them).

    The other is to use an SQL statement that includes information to link to the other database. There is info about doing that for Access in the "SQL" section of our Database Development FAQs/Tutorials (at the top of this forum)

  3. #3

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Question Re: create 1 query from two databases

    excuse me please for missing info;
    my data bases are on two computers connected via LAN.
    sql2000 is running on one system;
    .....................
    the .mde database is in a shared folder

    (a) i am failed to connect to .mde file on server machine ( LAN )kindly tell me the connection string

    (b) how to link the tables using ADO. and more over other
    data base is a .mde file

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: create 1 query from two databases

    a) See the "connection strings" link in my signature, they should have what you need.

    b) You don't, you use one of the options I mentioned before (in Access set up linked tables, or do the linking inside your SQL statements).

Posting Permissions

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



Click Here to Expand Forum to Full Width