雁过请留痕...
代码改变世界

Office/Access 2013 扩展支持xbase/DBF 文件

2016-07-22 11:47  xiashengwang  阅读(3490)  评论(0编辑  收藏  举报

最新的Access 2013 安装后,已经不能对dbf文件进行链接读取了,Access 2010以前的版本都可以,如果以前的项目用了Access链接大量的dbf文件的话,

升级Access 2013后,访问链接dbf文件的表,就会出错,具体的解决办法是,安装Access 2010的运行时环境,在改注册表。

我的环境是win7 64bit + Office 2013 plus 64bit。

1,下载Access 2010的支持环境AccessDatabaseEngine_X64.exe

https://www.microsoft.com/en-us/download/details.aspx?id=13255

2,修改注册表,将下面的文件保存为一个merge.reg文件,双击这个文件导入注册表。

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Access Connectivity Engine\Engines\Xbase]
"win32"="C:\\PROGRA~1\\COMMON~1\\MICROS~1\\OFFICE14\\ACEXBE.DLL"
"Mark"=dword:00000000
"DbcsStr"=hex:01
"Date"="MDY"
"Exact"=hex:00
"Deleted"=hex:01
"Century"=hex:00
"CollatingSequence"="Ascii"
"DataCodePage"="OEM"
"NetworkAccess"=hex:01
"PageTimeout"=dword:00000258

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE 5.0]
"Engine"="Xbase"
"ExportFilter"="dBASE 5 (*.dbf)"
"ImportFilter"="dBASE 5 (*.dbf)"
"CanLink"=hex:01
"OneTablePerFile"=hex:01
"IsamType"=dword:00000000
"IndexDialog"=hex:00
"CreateDBOnExport"=hex:00
"SupportsLongNames"=hex:00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE III]
"Engine"="Xbase"
"ExportFilter"="dBASE III (*.dbf)"
"ImportFilter"="dBASE III (*.dbf)"
"CanLink"=hex:01
"OneTablePerFile"=hex:01
"IsamType"=dword:00000000
"IndexDialog"=hex:00
"CreateDBOnExport"=hex:00
"SupportsLongNames"=hex:00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE IV]
"Engine"="Xbase"
"ExportFilter"="dBASE IV (*.dbf)"
"ImportFilter"="dBASE IV (*.dbf)"
"CanLink"=hex:01
"OneTablePerFile"=hex:01
"IsamType"=dword:00000000
"IndexDialog"=hex:00
"CreateDBOnExport"=hex:00
"SupportsLongNames"=hex:00

注意事项:

1,如果是在win7 64bit安装的32bit 的Office 2013,需要下载32位的AccessDatabaseEngine_X32.exe。

参考这篇文章:http://jonwilliams.org/wordpress/2014/03/21/enabling-xbase-dbf-support-in-microsoft-office-access-2013/

2,注册表内容用下面的内容替换:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access Connectivity Engine\Engines\Xbase]
 "win32"="C:\\PROGRA~2\\COMMON~1\\MICROS~1\\OFFICE14\\ACEXBE.DLL"
 "DbcsStr"=hex:01
 "Mark"=dword:00000000
 "Date"="MDY"
 "Exact"=hex:00
 "Deleted"=hex:01
 "Century"=hex:00
 "CollatingSequence"="Ascii"
 "DataCodePage"="OEM"
 "NetworkAccess"=hex:01
 "PageTimeout"=dword:00000258

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE 5.0]
 "Engine"="Xbase"
 "ExportFilter"="dBASE 5 (*.dbf)"
 "ImportFilter"="dBASE 5 (*.dbf)"
 "CanLink"=hex:01
 "OneTablePerFile"=hex:01
 "IsamType"=dword:00000000
 "IndexDialog"=hex:00
 "CreateDBOnExport"=hex:00
 "SupportsLongNames"=hex:00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE III]
 "Engine"="Xbase"
 "ExportFilter"="dBASE III (*.dbf)"
 "ImportFilter"="dBASE III (*.dbf)"
 "CanLink"=hex:01
 "OneTablePerFile"=hex:01
 "IsamType"=dword:00000000
 "IndexDialog"=hex:00
 "CreateDBOnExport"=hex:00
 "SupportsLongNames"=hex:00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE IV]
 "Engine"="Xbase"
 "ExportFilter"="dBASE IV (*.dbf)"
 "ImportFilter"="dBASE IV (*.dbf)"
 "CanLink"=hex:01
 "OneTablePerFile"=hex:01
 "IsamType"=dword:00000000
 "IndexDialog"=hex:00
 "CreateDBOnExport"=hex:00
 "SupportsLongNames"=hex:00

win7 32bit 下安装 Office 2013 32bit的话,上面的注册表文件的内容值做相应的修改,原则就是注册表的key路径要匹配你2010的安装路径,

例如这些路径是否正确:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access Connectivity Engine\ISAM Formats\dBASE IV]

举一反三,不再例举。