正如標題所說,我試圖使用openrowset將FoxPro dbf文件導入sql服務器。起初,我試圖將DBF導出到xls文件並使用導入/導出嚮導導入。這通常工作得很好,但是有一個字段有時會包含一個非常長的字符串,並且在從dbf導出到xls期間,該字符串將被截斷爲4096個字符。試圖將FoxPro DBF文件導入到SQL Server
我找到了一個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, Level 16, State 1, 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
後someinvestigation我嘗試安裝及部件,但是當我試圖安裝FoxPro中msi文件(found here),我得到這個錯誤:
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.
所以,我正式在這裏失去。有沒有人有關於如何使openrowset正常工作或者導入dbf文件的其他方式的建議?
這似乎已經完成了。萬分感謝。我一直在爲此掙扎數日。我會跟我的老闆談談購買許可證的問題。 – Pat