Results 1 to 4 of 4

Thread: ADO...connecting two diff ODBC --databases

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    15
    hi
    i was wondering if we could connect two diff. databases and then link them thr. two diff fields from diff. tables and databases....e.g.

    datbase1
    tableA
    fld1 fld2 fld2

    database2
    table B
    fld4 fld5 fld6

    so connect thr. 2 diff. recordset....
    fld1 to fld5

    and then add this output in combo box .... like

    combo1.additem rs1!fld1, rs1!fld2, rs2!fld4 , rs2!fld6




  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Depends.

    SQL server 6.5 on same server - yes
    SQL server 6.5 on different servers - no
    Sql server 7.0 - appears to be yes
    Access (any version) without attached tables - no
    Access with attached tables - yes

    The two tables will need to have a field in common (name does't have to be but the data type and content need to be).

    You'll only need one ADO connection to do it, if you can do it.

  3. #3
    New Member
    Join Date
    Mar 2000
    Posts
    7
    Great to know. But how
    To open two databases in one ADO connection?

    And what is attacted table?

    lupus


    Depends.

    SQL server 6.5 on same server - yes
    SQL server 6.5 on different servers - no
    Sql server 7.0 - appears to be yes
    Access (any version) without attached tables - no
    Access with attached tables - yes

    The two tables will need to have a field in common (name does't have to be but the data type and content need to be).

    You'll only need one ADO connection to do it, if you can do it.

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    If you have your tables attached (MS ACCESS), your SQL syntax is the same as joining two tables native to that database

    example:
    Select * from Customers, Orders where Orders.CustID = Customers.CustID

    Customers could be an attached table from another database, or it could be a regular table in the same DB

    HTH

    Tom

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