我导入几个'|' 用以下文件将文件分隔到我的DB:
Private Sub cmdImport_Click()
Dim i As Integer
Dim path1 As String
path1 = "C:\ImportFiles"
Destination = "C:\ImportFiles\processed"
Set fs = Application.FileSearch
With fs
.LookIn = Path1
.FileName = "*.*"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
DoCmd.TransferText acImportDelim, "ImportRPS", "tbImportRPSTemp", .FoundFiles(i), False
fileName = .FoundFiles(i)
fileName = Replace(fileName, path1, "")
Set fs1 = CreateObject("Scripting.FileSystemObject")
fs1.MoveFile Path1 & fileName, Destination & Format(Now, "YYYYDDMMTHHMMSS") & fileName
Next i
Else
MsgBox "No files to update", vbInformation
Exit …Run Code Online (Sandbox Code Playgroud)