MS ACCESS VBA 移动/复制文件

问题描述

我正在使用下面的代码来引用一个表,该表具有将文件一个位置移动(或复制)到另一个位置的完整路径信息。但是,它没有移动任何东西,而是根据我的 Debug.Print 消息完成(移动完成 2/22/2021 1:22:41 PM)。对我缺少的东西有什么想法吗?

此外,我想在源文件中构建文件夹/子文件夹结构......但不知道如何实现......以及如何做到这一点的指针?

@mixin u($prop,$value: null) {
  @if ($prop and $value) {
      #{$prop}: get-tokens($tokens,$prop,$value);
  } @else {
    .u-#{$prop} {
      @each $item,$value in map-get($tokens,$prop) {
        &-#{$item} {
          #{$prop}: $value;
        };
      }
    }
  } 
}

感谢您提供的任何帮助。

解决方法

到目前为止,我已经得到了以下代码来处理文件路径

Sub CopyFilesFromTable2()

On Error GoTo ErrorHandler

Dim source As String
Dim destination As String
Dim FSO As New FileSystemObject
Dim SQL As String
Dim RS As DAO.Recordset
Dim db As DAO.Database



 'Test Table
  SQL = "select * from file_test"

 'Prod Table
 'SQL = "select * from file"

Set FSO = CreateObject("Scripting.FileSystemObject")
Set db = CurrentDb
Set RS = db.OpenRecordset(SQL)

 source = RS!LocalFile
File = VBA.FileSystem.Dir(source)
destination = "D:\Temp\Test\"

With RS

If Not .BOF And Not .EOF Then

.MoveLast
.MoveFirst

While (Not .EOF)

FSO.CopyFile RS!LocalFile,destination

.MoveNext

Wend


 End If

.Close

End With


ExitSub:

Set RS = Nothing
'set to nothing
MsgBox "Done!"

Exit Sub

ErrorHandler:
MsgBox Err,vbCritical

Resume ExitSub


End Sub