访问2016导出文本固定宽度不可能 [英] Access 2016 Export Text Fixed Width No Possible

查看:74
本文介绍了访问2016导出文本固定宽度不可能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的最后一次"严重"使用Access是Access'97,稍微使用Access 2010。

My last "serious" use of Access was Access'97, and a little with Access 2010.

在Access 2016中,我使用Access查询创建单列数据,行数据表示批处理文件命令我希望在运行之前将其导出为文本

In Access 2016 I have used an Access query to create a single column of data, with row data representing batch file commands which I want to export as text before running

生成查询后,我发现安装的Access 2016非常受限于导入/导出文本,并且无法运行通常的向导或者为任务设置导出规范 - 我得到的是指定文件
名称的选项(不是因为忽略了扩展名并且自动添加了".txt")以及保存规范的机会。

After generating the query I discovered that Access 2016 as installed is extremely limited with Import/Export for text and there is no way to run the usual wizards or set up an export specification for the task - all I get is the option to specify the file name (not really as the extension is ignored and ".txt" added automatically) and the chance to save the specification.

我无法使用语法:

DoCmd.TransferText TransferType:= acExportFixed,TableName:=" qryWriteBat1",_

    FileName:=" qryWriteBat1.bat"

DoCmd.TransferText TransferType:=acExportFixed, TableName:="qryWriteBat1", _
    FileName:="qryWriteBat1.bat"

https://msdn.microsoft.com/en-us/library/office/ff835958.aspx

https://msdn.microsoft.com/en-us/library/office/ff835958.aspx

描述了使用DoCmd.TransferText方法(Access)并声明acExportDelim是默认值,而固定宽度:


describes use of the DoCmd.TransferText Method (Access) and states that acExportDelim is default, while for fixed width:

"一个字符串表达式,它是您在当前数据库中创建并保存的导入或导出规范的名称。对于固定宽度的文本文件,您必须指定参数或使用schema.ini文件,该文件必须与导入,链接或导出的文本文件存储在同一文件夹
中。要创建模式文件,可以使用文本导入/导出向导来创建文件。对于分隔文本文件和Microsoft Word邮件合并数据文件,您可以将此参数留空以选择默认的
导入/导出规范。"

"A string expression that's the name of an import or export specification you've created and saved in the current database. For a fixed-width text file, you must either specify an argument or use a schema.ini file, which must be stored in the same folder as the imported, linked, or exported text file. To create a schema file, you can use the text import/export wizard to create the file. For delimited text files and Microsoft Word mail merge data files, you can leave this argument blank to select the default import/export specifications."

因此需要一个规范,并且它是通过向导创建的 - 据我所知,Access 2016中不存在向导。

So a specification is needed, and it is created through the wizard - the wizard doesn't exist in Access 2016 as far as I can see.

提供的文本的默认导出会在导出的文本周围放置边框,因此无法使用。

The default export of text provided puts a border around the exported text so unusable.

保存默认导出供以后使用,并尝试编辑(规范),只提供编辑文件名的功能,无法编辑或定义分隔符或固定宽度格式等 - 没有"高级"在其他
应用程序中找到的按钮。

Saving the default export for later use, and attempting to edit (the specification), only provides the ability to edit the filenames, with no ability to edit or define delimiters, or fixed width formats etc - no "Advanced" button as found in other applications.

搜索该主题表明"修复"按钮。更新了很多版本,开始这个,但是我还没有找到如何恢复向导来创建规范,以便在新安装的office365而不是
升级的干净机器上进行编辑。

Searching on the topic suggests that a "fix" update many releases back started this, but I have not been able to find how to restore the wizards to create specifications for editing on a clean machine with a new install of office365 rather than an upgrade.

我的后备可能是让Access97无效,看看我是否至少可以创建规范和副本(我的任何机器上都没有Access2010)

My fallback may be to dust off Access97 and see if I can at least create the specification and copy is across (I don't have Access2010 available on any of my machines)

有没有人有一个干净安装的解决方案,允许创建和编辑Access2016导入/导出规范以获得所有可用选项?

Does anyone have a solution to a clean installation that will allow Access2016 Import/Export specifications to be created and edited for the full range of options available?

推荐答案


生成查询后,我发现安装的Access 2016极为受限于导入/导出文本,并且没有办法运行通常的向导或为任务设置导出规范 - 我得到的是指定文件
名称的选项(不是因为扩展被忽略而且".txt&qu" ot;自动添加)以及保存规范的机会。

After generating the query I discovered that Access 2016 as installed is extremely limited with Import/Export for text and there is no way to run the usual wizards or set up an export specification for the task - all I get is the option to specify the file name (not really as the extension is ignored and ".txt" added automatically) and the chance to save the specification.

嗨Petex,

我从不使用Access的导入/导出功能,因为在很多情况下它太有限了。

I never use the Import/Export functionality of Access, because in many cases it is too limited.

作为解决方法,或更好:更灵活的工具,  我使用2个例程打开外部文件(参见帮助中的OPEN),一个用于INPUT,一个用于OUTPUT。

As workaround, or better: as far more flexible tool, I use 2 routines to open an external file (see OPEN in Help), one for INPUT, one for OUTPUT.

用它可以逐行读取或写入文件,并在必要时处理数据。

With that you can read or write the file, line by line, and process the data if necessary.

Imb。


这篇关于访问2016导出文本固定宽度不可能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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