【发布时间】:2020-07-05 22:14:58
【问题描述】:
我正在使用 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
【问题讨论】: