>Hi All:
> How do you combine two different connections from two different DSN into one in order to gather data from different databases. Fox example I want to form a join from two different databases and I am not sure how to accomplish this.
>Thanks
MA,
There are a number of ways to do this. Two of which are:
1. Combine the queries within the backendStructure the SQL statement passed to SQLExec so that the backend connects to both databases and combines the query for you. If you can connect to both, it stands to reason that one of the backend servers should be able to connect to the other given the correct connection information. In SQL Server, this could be a Linked Server. If using Oracle, you could create a synonym to the other database. The query would have the appropriate alias/database.owner.table included in the statement to access the various tables.
2. Combine the queries within VFPCreate cursors via two separate calls to SQLExec passing the appropriate connection handle. Then join those two result sets together using another SQL statement with a UNION clause.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao