Try this TSQL:
Main Topics
Browse All TopicsI would like to create a linked server, that points to a Visual Fox Pro database. The ultimate goal, is that I need to select items from an existing table.
I have downloaded the VFP OLE DB driver, and it is available as a choice for "provider".
When setting up the linked server, I do not know what to fill in for the following fields.
Product Name
Data Source
Provider String
Any help GREATLY appreciated.
Regards,
td
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To Dportas,
Thank you for your reply.
I was able to create the linked server, using the code you suggested:
EXEC sp_addlinkedserver
@srvproduct='',
@server='VFP01',
@provider='VFPOLEDB',
@datasrc='G:\PPartner\Data
SELECT * FROM VFP01...line_it
When attempt to do the above select, I get the following error message:
OLE DB provider "VFPOLEDB" for linked server "VFP01" returned message "Invalid path or file name.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "VFPOLEDB" for linked server "VFP01".
Am I missing something obvious here? Any suggestions what I might do next?
Regards, td
How to add a Visual FoxPro database to SQL Server as a linked server
http://support.microsoft.c
Is it possible that G: is a mapped drive rather than a physical one? Or that SQL Server can't access G:\PPartner\Data\? Or did you just mis-key the word "Partner"?
You need to use a path that is accessible to the account under which the SQL Server is running. Don't use a mapped drive and ensure the service account has the necessary permissions. If the path is not on the same server then the service account must be a DOMAIN account, not local service.
Wow- you were correct. I was using G:, which was mapped. There is an actual D:, which is an absolute step in the right direction.
I now have a followup question. I know get the error that "table does not exist".
Any suggestions on how I can guess the table name used in Fox Pro. I believe that the items are in a file called "LINE_IT.dbf". I have been assuming that the table name is LINE_IT as well.
I am using the syntax:
SELECT *
FROM OPENROWSET('vfpoledb',
'D:\Data\PPartner';'';'',
'SELECT * FROM LINE_IT') AS X;
Any suggestions greatly appreciated.
td
tmedley- thank you for your input. I just had an aha moment.
I copied the .dbf file to a new directory, where I opened up the permisions (everyone, all).
Now I can access the items just fine.
When you create a linked server, do you have any idea what user is being used to connect to the data source? What user should I give permissions (without opening this up to the world), so it will work?
td
Business Accounts
Answer for Membership
by: dportasPosted on 2008-01-30 at 11:08:50ID: 20780021
Assuming the source of the DBFs is C:\folder:
SELECT *
FROM OPENROWSET('vfpoledb',
'C:\folder\';'';'',
'SELECT * FROM table_name') AS X;
Alternatively, create a linked server:
EXEC sp_addlinkedserver
@srvproduct='',
@server='VFP01',
@provider='VFPOLEDB',
@datasrc='C:\folder\';
SELECT * FROM VFP01...table_name;