正如标题所说,我正在尝试使用openrowset将FoxPro dbf文件导入sql server.起初我尝试将DBF导出到xls文件并使用导入/导出向导导入.这通常很好用,但是有一个字段有时会保存一个非常长的字符串,并且在从dbf导出到xls期间,此字符串将被截断为4096个字符.
我找到了一个old post,其中包含如何使用openrowset执行此操作的说明.
当我尝试第一个答案时:
select * from openrowset('MSDAsql','Driver=Microsoft Visual FoxPro Driver; SourceDB=\\path\; SourceType=DBF','select * from TABLE.DBF')
我收到错误:
OLE DB provider "MSDAsql" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". Msg 7303,Level 16,State 1,Line 1 Cannot initialize the data source object of OLE DB provider "MSDAsql" for linked server "(null)".
当我尝试第二个答案时:
select * from openrowset('VFPOLEDB','\\Path\';'';'','select * from TABLE.DBF')
我收到错误:
Msg 7403,Line 1 The OLE DB provider "VFPOLEDB" has not been registered.
我试图用regsvr32手动注册OLE * .dll文件,但只有一些工作.在ole32,oleacc,oleaut32和oleprn上,我获得了成功的信息.在oleacchooks,oleaccrc,oledlg和oleres上我收到了这个错误:
The module "oleacchooks" was loaded but the entry-point DllRegisterServer was not found. Make sure that "oleacchooks" is a valid DLL or OCX file and then try again
在some investigation之后我尝试安装组件,但是当我尝试为FoxPro(found here)安装msi文件时,我收到此错误:
An error occurred while processing the last operation. Error code 80110408 - Error occurred reading the application file The event log may contain additional troubleshooting information.