all groups > sql server odbc > march 2006 >
You're in the

sql server odbc

group:

Linking to FoxPro files from SQL Server


Linking to FoxPro files from SQL Server Teri Welch
3/10/2006 12:53:19 PM
sql server odbc:
Hello,

We are fairly new to SQL Server and and hope someone can help us. From SQL
Server we need to link to FoxPro tables in the accounting (SBT) system. We
started to setup a Linked Server but didnt get very far. For example if we
wanted to link to a FoxPro Product table called PROD we would see the
following files to choose from: PROD.DBF, PROD.CDX, and PROD.ADX). Assuming
the FoxPro files are located in C:\DATA how can we accomplish the linking?

1) Would we want to use the ODBC driver or the Visual Foxpro driver to link?
The FoxPro version is 5 years old.

2) Based on the information given above, what are the specific parameters
needed to create the linked server?

3) Once a link is established, can we filter records from the underlying
FoxPro table because it contains hundreds of thousands of records we dont
need to access.

Thanks,
Teri



Re: Linking to FoxPro files from SQL Server Cindy Winegarden
3/10/2006 1:28:48 PM
Hi Teri,

Download and install the latest FoxPro and Visual FoxPro OLE DB data
provider from msdn.microsoft.com/vfoxpro/downloads/updates.

I'm using SQL 2005; your dialog may be a little different. For a linked
server in SQL Server use the following:

Linked Servers > New Linked Server ...

Linked Server: MyLinkedServer
Provider: Choose "Microsoft OLE DB Provider for Visual FoxPro"
Product name: Visual FoxPro (I think this is optional)
Data source: "C:\Program Files\Microsoft Visual
FoxPro9\Samples\Northwind\Northwind.dbc" (Include quotes since there's
spaces in the string.)

Provider string: VFPOLEDB.1
Location: (blank)
Catalog: (blank)
Security page and Server Options page take defaults.

A linked server acts pretty much like any other SQL table - the data is not
"imported" so you won't get all the records you don't want if you filter
them out using your Where clause. To select data use :

Select * From MyLinkedServer...TableName Where Record <> OnesIDon'tWant


--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


[quoted text, click to view]

AddThis Social Bookmark Button