Information générale
Catégorie:
Bases de données 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)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement