在Access中导入CSV时设置字段值

时间:2016-06-06 22:27:08

标签: vba csv access

我使用Access VBA和传输文本方法导入数千个CSV文件。我需要将文件名或其某种格式添加到表中以反映它来自的文件。我已经存储了变量文件名以便导入它。如何附加代码以引用“fil”变量的名称?

With DoCmd
    .SetWarnings False
    For Each fil In fld.Files
        If UCase(Right(fil.Name, 3)) = "CSV" Then
            .TransferText acImportDelim, , DestTable, fil.Path, False



        End If

    Next
    .SetWarnings True
End With

1 个答案:

答案 0 :(得分:1)

试试这个:

template <typename ...Args>
void doSomething(Args &&... args)
{
    doSomethingImpl(std::make_index_sequence<sizeof...(Args)>(),
                    std::forward<Args>(args)...);
}

template <typename ...Args, std::size_t ...N>
void doSomethingImpl(std::index_sequence<N...>, Args &&... args)
{
    bar(oneCommand(std::forward<Args>(args), N)...);
}
相关问题