Export MS Access tables as dBase 5 through VBA MS_Access

混江龙づ霸主 提交于 2019-12-11 03:34:10

问题


How can I export a single table as a dBase 5 file through VBA?

Currently I am using this VBA code:

DoCmd.TransferDatabase _
acExport, _
"dBase IV", _
"DB_Total", _
acTable, _
"DB_Total", _
"C:\Data", _
False

But when I try to execute this code, I get the following error (in dutch, so roughly translated):

"DB_Total is not a valid path"

But I'm not really sure what the path is, because the table I am trying to export is inside the Access file, right?


回答1:


You should need the full path to the output database in the 4th parameter:

 DoCmd.TransferDatabase acExport, "dBase IV", "c:\full\path\to\output", acTable, "TableNameInAccess", "DBFTable", False, False

Also I believe you will have to limit your output (DBFTable) to 8 or fewer characters because it is dBase IV.



来源:https://stackoverflow.com/questions/15019964/export-ms-access-tables-as-dbase-5-through-vba-ms-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!