MS Access中的DoCmd.TransferText无法正常工作(“引擎找不到对象") [英] DoCmd.TransferText in MS Access not working ("engine could not find the object")

查看:266
本文介绍了MS Access中的DoCmd.TransferText无法正常工作(“引擎找不到对象")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为"Tk20F7_agg"的表,试图将其导出为具有自定义规范的.txt文件.代码在下面,但是当我运行它时,出现此错误: "Microsoft Access数据库引擎找不到对象'Tk2020181903#txt."

I have a table called "Tk20F7_agg" that I am trying to export as a .txt file with custom specifications. The code is below but when I run it, I get this error: "The Microsoft Access database engine could not find the object 'Tk2020181903#txt.'"

TempName01 = "Tk20" & Format(Date, "yyyyddmm")
ExportPath = DLookup("Export_Path", "OmniDB_system01")

Application.FileDialog(msoFileDialogSaveAs).Title = "Export Tk20 File7 (Testing)"
Application.FileDialog(msoFileDialogSaveAs).InitialFileName = TempName01 & ".txt"

intChoice = Application.FileDialog(msoFileDialogSaveAs).Show

If intChoice <> 0 Then
strPath = Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1)
End If

DoCmd.TransferText acExportDelim, "Tk20_File7_spec", "Tk20F7_Agg", TempName01 & ".txt", True

任何解决此问题的帮助将不胜感激!

Any help on fixing this would be greatly appreciated!

推荐答案

根据我的经验,我发现,当修改查询或表的结构并修改查询或表的结构时,可能会生成此特定(且具有误导性的)错误消息.相关的导出规范未更新以反映更改.

In my experience, I've found that this particular (and rather misleading) error message can be produced when the structure of a query or table is modified and the associated Export Specification is not updated to reflect the changes.

要解决该错误,建议使用导出文本文件"向导手动"导出目标对象,然后重新保存导出规范.

To resolve the error, I would suggest exporting the target object 'manually' using the Export Text File wizard, and re-save the Export Specification.

这篇关于MS Access中的DoCmd.TransferText无法正常工作(“引擎找不到对象")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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