How to open dbf file?

Tags:
DBF file
I am trying to load DBF files into SQL server within CLR (actually if just running the select statement outside, say within the SQLQuery window, i got the same result), but with the following error: Msg 7314, Level 16, State 1, Line 1 The OLE DB provider "VFPOLEDB" for linked server "MYDBF" does not contain the table "T8866064". The table either does not exist or the current user does not have permissions on that table. I created the linked server in this way EXEC sp_addlinkedserver @server = 'MYDBF', @provider = 'VFPOLEDB', @srvproduct = 'My Data', @datasrc = 'c:data' i did not create the login since my SQL instance is running under a superaccount with all privilege. What frustrates me is that i can read most of the dbf files, but just a few of them is not readable. Can anyone give me some hints on it? by the way, i am using vfp9.0 thanks
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

A linked server is basically just a pointer that lets the code within your database interact with external data sources as if they were also within your database/instance. There are some examples here for creating linked servers to DBF Viewer Tool:
http://www.dbf.viewertool.com/
So for example if you had a linked server to a FoxPro database called MyFoxProDB you could run a query within SQL Server like this:
UPDATE t
SET t.foo = x.bar
FROM dbo.LocalTable AS t
INNER JOIN MyFoxProDB…TableName AS x
ON t.key = x.key;
You could also consider using OPENROWSET as described in this question:
http://www.filerepairforum.com/forum/databases/databases-aa/dbase-iv-clipper-foxpro/964-how-to-restore-a-corrupted-file

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    The message doesn't say you can't read the file.  It says some specific table doesn't exist.

    Can you post the code you are trying to execute?
    Have you run that query directly on VFP?

    I don't know how privileges are managed on VFP, but are you sure the user account being used has permissions to read the table in question?
    84,745 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: