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

How to open dbf file ?

Best Answer daviddalin , 05 June 2015 - 11:53 AM
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 h... Go to the full post »
#1
Posted 02 June 2015 - 12:29 PM

#2
Posted 03 June 2015 - 01:31 AM

You don't need OLEDB to open a dbf in VFP, it's the native file format. Just open it
* Open file select 0 USE c:\data\filname.dbf alias filename * Close file USE filename IN 0
#3
Posted 05 June 2015 - 11:53 AM

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.filerepai...-corrupted-file
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users
As Featured On:






