MS Access 2013:自动跳过导入列(如果尚未存在于预先存在的表中)(MS Access 2013: Automate skip importing column if not already

编程入门 行业动态 更新时间:2024-10-25 17:24:15
MS Access 2013:自动跳过导入列(如果尚未存在于预先存在的表中)(MS Access 2013: Automate skip importing column if not already in pre-existing table)

关于Access的一个非常烦人的事情是,当使用导入向导导入CSV文件时,如果CSV中的某列不是要导入的表中的字段,则会出现错误并关闭导入。 如果源文件中的列不在现有表中,它应该提供跳过列的选项。 是的,如果从源文件创建新表,它确实提供了跳过的选项,但这不是我正在做的事情。 是否有解决方案或自动化方法? 使用VBA Access导入功能是否允许这样做?

我想跳过这些列的原因是因为它们是客户端提交的Excel文件中的计算列,文件转换为CSV以导入到Access,我可以使用Access中的SQL轻松地重新计算它们。 没理由把它们放在桌子上。

One really annoying thing about Access is that when using the import wizard to import a CSV file, if there is a column in the CSV that isn't a field in the table being imported into, it gives you an error and shuts down the import. It should provide an option to skip columns in the source file if it isn't in the already existing table. Yes, it does give the option to skip if creating a new table from the source file, but that isn't what I am doing. Is there a solution to this or a way to automate it? Does using the VBA Access import function permit this?

The reason I want to skip these columns is because they were calculated columns in Excel file submitted by client, file is converted to CSV for importing in to Access, and I can easily recalculate them with SQL in Access. No reason to have them in the table.

最满意答案

运行导入向导时,可以按您选择的名称保存规范。

然后使用:

DoCmd.TransferText acImportDelim, SpecificationName, ... etc.

When running the import wizard, you can save the specifications by some name you choose.

Then use:

DoCmd.TransferText acImportDelim, SpecificationName, ... etc.

更多推荐

本文发布于:2023-08-04 17:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1420696.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跳过   MS   Access   Automate   column

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!