我有一个按钮,让我选择一个文件来选择,文件的位置保存到文本框,我使用文本框中的位置将文件上传到数据库,我收到错误。
" INSERT INTO查询不能包含多值字段。"
以下是我的代码。
Private Sub btn_Browse_Click()
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
f.allowMultiSelect = True
If f.Show Then
For Each varItem In f.selectedItems
strFile = Dir(varItem)
strFolder = Left(varItem, Len(varItem) - Len(strFile))
MsgBox "Folder: " & strFolder & vbCrLf & _
"File: " & strFile
Me.txt_PicSource = strFolder + strFile
Next
End If
Set f = Nothing
...
CurrentDb.Execute _
"INSERT INTO Field_Return_Table(Date_FRL, Time_FRL, Client_FRL, Product_FRL, LOT_FRL, Territory_FRL, Tracking_FRL, Condition_FRL, Location_FRL, Completed_By_FRL, Comments_FRL, Attachment_FRL) " & _
"VALUES ('" & strDate & "', '" & strDate & "', '" & Me.combo_Client.Value & "', '" & Me.txt_Product.Value & "', '" & Me.txt_Lot.Value & "', '" & Me.txt_Territory.Value & "', '" & Me.txt_Track.Value & "', '" & strCondition & "', '" & strLocation & "', '" & strUser & "', '" & Me.txt_Comment.Value & "', '" & Me.txt_PicSource.Value & "')"
...
有关如何通过INSERT INTO上传此文件的任何提示吗?