Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Location
    Laguna, Philippines
    Posts
    147

    Unanswered: Join Queries Between Two Databases

    Hi to all,

    I have a vb6 project and I have two access tables in seperate database.
    my problem is how can i create a join query between those two tables.


    thnks in advance
    Give me a place to code and i shall move the earth!

  2. #2
    Join Date
    Jun 2003
    Location
    İstanbul
    Posts
    19
    Hi,

    Let's assume that;
    - MyTable1 is in DBFile1.mdb
    - MyTable2 is in DBFile2.MDB
    - You want to run the query in DBFile2.MDB.
    You can attach MyTable1 to DBFile2.MDB with the following code and run any query that refers both MyTable1 and MyTable2.

    Dim tdef As New TableDef, db as Database
    Set db = Workspaces(0).OpenDatabase("<Path of DBFile2.MDB>", False, False, ";pwd=<password>")

    tdef.name = "MyTable1"
    tdef.connect = ";DATABASE=<Path of DBFile1.MDB>;pwd=<password>"
    tdef.SourceTableName = "MyTable1"
    db.TableDefs.Append tdef

    I hope it helps.
    Kezban

  3. #3
    Join Date
    Dec 2004
    Location
    Laguna, Philippines
    Posts
    147
    thnks for your answer, but will the processing speed be a factor when i had thousands of records in a single table? Also, i am currently using adodb.recordset in creating queries, is there any versions of your code to adodb.recordset?

    thanks for your time...
    Give me a place to code and i shall move the earth!

Posting Permissions

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