尝试将FoxPro DBF文件导入到SQL Server [英] Trying to Import FoxPro DBF File to SQL Server

查看:225
本文介绍了尝试将FoxPro DBF文件导入到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所述,我正在尝试使用openrowset将FoxPro dbf文件导入sql服务器.最初,我尝试将DBF导出到xls文件并使用导入/导出"向导导入.这通常可以正常工作,但是有一个字段有时包含一个很长的字符串,并且在从dbf导出到xls的过程中,该字符串被截断为4096个字符.

As the title says, I'm trying to import a FoxPro dbf file into sql server using openrowset. At first I tried to export the DBF to an xls file and import using the Import/Export wizard. This works pretty well normally, but there is one field that sometimes holds a really long string, and this string is being truncated at 4096 characters during the export from the dbf to xls.

我找到了旧帖子,并附有说明关于如何使用openrowset做到这一点.

I found an old post with instructions on how to do this using openrowset.

当我尝试第一个答案时:

When I try the first answer:

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)".

当我尝试第二个答案时:

When I try the second answer:

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上,我收到此错误:

I tried to register the OLE*.dll files manually with regsvr32, but only some of them worked. On ole32, oleacc, oleaut32, and oleprn I got a success message. On oleacchooks, oleaccrc, oledlg, and oleres I got this error:

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

​​一些 调查我尝试安装组件,但是当我尝试安装FoxPro的msi文件时(在这里找到),出现此错误:

After some investigation I tried to install the componet, but when I tried to install the msi file for FoxPro (found here), I got this error:

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文件有其他建议吗?

So, I'm officially lost here. Does anybody have suggestions on how to get openrowset to work, or some other way of importing the dbf file?

推荐答案

Pat,您可以使用DBF Commander Pro来完成此任务.

Pat, you can use DBF Commander Pro for this task.

下载,安装,然后单击文件->导出到DBMS.在出现的窗口中,单击构建"按钮以构建连接字符串:选择SQL Server的MS OLEDB Provider,然后从列表中选择服务器,提供登录名和密码,选择一个数据库,单击确定":

Download it, install, then click File -> Export to DBMS. In the window appears click Build button in order to build the connection string: select MS OLEDB Provider for SQL Server, then choose your server from the list, provide login and password, select a database, click OK:

在导出到DBMS"窗口中,选择要将源DBF文件导入到的目标表,然后单击导出".

In the Export to DBMS window select the destination table you want to import source DBF file to, then click Export.

有关将DBF导出和导出到数据库的更多信息,您可以在此处.

More info on import and export DBF to a database you can find here.

P.S.该应用程序具有功能齐全的20天免费试用期.

P.S. The app has fully functional free trial 20-days period.

这篇关于尝试将FoxPro DBF文件导入到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆