General information
Category:
Database DAO/RDO/ODBC/ADO
>Old time VFP'er doing first job with ASP+VBS+ADO
>
>So far so good, but now I have to get data from a table in SQL Server, then get one (same) column of a table in another database and eliminate any record that appears in both sets.
>
>That should be fairly easy to do in TSQL but can I JOIN two tables in different databases? (i.e. two open ADO connections?) Somehow I don't think so. If that's the case, on to plan B: persist the first result set and query it against the second database. In VFP that is easy to do with a temporary cursor. How do I do that in vbs w/ADO?
>
>Any help appreciated.
There's a couple of routes by using linked servers:
- For frequent access to the query:
Select * From RemoteServer.myDatabase.dbo.myTable
(You can also use OPENQUERY with linked servers)
- If you seldom run the query then use OPENROWSET as in:
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\MSOffice\Access\Samples\Northwind.mdb';'Admin';'';Employees)
(this last example from books online)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only