You can set up a linked server. That way when you need to query you can use OPENQUERY et al and you don't have to keep typing connection information. First you'll need to set up a DSN on your SQL Box that points to your VFP data,in windows 2000 you'll find this in control panel\administrative tools\odbc in NT it will be in control panel. Be sure you use UNC to path to it if it is on a different box than your SQL Server, also be certain to uncheck the fetch data in background option as this will cause untold nastiness. Then go into the security folder on your SQL Enterprise Manager, right click on linked servers, select New linked server, then provide a name for it, under server type select other data source, in the provider name combo box select Microsoft OLE DB provider for ODBC, in the Product Name text box put MSDASQL, in the Data Source box put the name of the VFP DSN you created.
You can set information in the other tabs on this form but that should be enough. Then when you want to query the linked server use syntax like:
SELECT * FROM OPENQUERY(<your linked servername>,'Your VFP SQL Statement')
JHall
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.