# Join association across two databases with :through

**URL:** <https://www.ruby-forum.com/t/join-association-across-two-databases-with-through/107528>\
**Category:** Rails\
**Created:** [June 22, 2007, 5:16pm UTC](https://www.ruby-forum.com/t/join-association-across-two-databases-with-through/107528 "2007-06-22T17:16:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![syg6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@syg6](https://www.ruby-forum.com/u/syg6)\
**Post date:** [June 22, 2007, 5:16pm UTC](https://www.ruby-forum.com/t/join-association-across-two-databases-with-through/107528/1 "2007-06-22T17:16:48Z")

</div>

Hi,

I’m trying to join two tables that are in different databases. I  
tried using :through but I’m getting complaints about trying to span  
databases. I’ve also tried find\_by\_sql and just plopped the SQL into  
the function but I get complaints about one user not being able to  
access the other database. I know I could just make both databases  
accessible by the same username/password pair but, besides being  
hacky, I don’t have control of the databases.

Thanks for any help you can give me on this,  
Bob
