I just created a database data1 with a table table1 having a field1 in it, indexed on field1.
Then I created database data2 with a table table2 having a field1 in it, indexed on field1.
I closed data. Then I did the following from the command window.
use data1!table1 order 1
sele 0
use data2!table2
set relation to field1 into table1
The relationship worked.
If your question is how to create a persistent relationship between tables in two different databases, I believe that is not possible.