很难让这个工作。
我正在循环通过对话框生成的文件列表并插入到表中。我无法让变量正常工作。查询表达式中的语法错误(缺少运算符)。
Dim SQLCode As String
Dim varFile As Variant
Access.DoCmd.OpenQuery ("ClearFileList")
Set fDialog = Application.FileDialog(1)
With fDialog
.AllowMultiSelect = True
.Title = "Select One or More Files"
.Filters.Clear
.Filters.Add "Lineviewer Files", "*.CSV"
If .show = True Then
For Each varFile In .SelectedItems
SQLCode = "INSERT INTO Filelist ([FileName]) VALUES (" & varFile & ");"
Access.DoCmd.RunSQL SQLCode
Next
End If
End With
谢谢