关于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.更多推荐
发布评论