2
votes

I try to read Foxpro DBF files with Microsoft SQL Server 2008 R2.

I write this query:

SELECT * 
FROM OPENROWSET('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;
SourceDB=D:\DB\;
SourceType=DBF',
'SELECT * FROM MyTable')

Also I installed 'VFPOLEDB' provider to run the query. But it does not run and I got this error:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

I ran this query correct before,but it does not run now,I don't know why!I Google that but it doesn't helpful.

How can I read DBF files using SQL Server 2008 R2? My DBMS are running on Windows 7 OS, and also Windows 2003 Server.

Thanks in advance, Mohsen.

1
Have you tried directly using the VFPOLEDB provider? SELECT * FROM OPENROWSET('VFPOLEDB', 'D:\DB\MyTable.dbf,'SELECT * FROM MyTable') - Glenn Stevens
Alternatively: have you tried going through the Import Data wizard? Just pick your DBF file and tell it where to copy the data to - marc_s
@Stevens I get this one:Cannot initialize the data source object of OLE DB provider "VFPOLEDB" for linked server "(null)". - Jupiter
@marc_s ,I wanna read data automatically(like define a query with special execution time to update main table via SQL Jobs.).So I don't want use Import tools. - Jupiter

1 Answers

0
votes

This is a problem with SQL Server 2008 R2. You can downgrade to SQL Server 2005 or SQL Server 2008 to get this working again.