I am copying a password protected backend database with the code below. I get the following error "permission denied". The code works perfectly if the database is not password protected. What am I missing to get password protected backends to copy?
Public Sub Test0()
Dim SourceFile, DestinationFile
SourceFile = CurrentProject.Path & "\" & "2 DB BEs\Champ 22_sales_be.accdb" ' Define source file name.
DestinationFile = CurrentProject.Path & "\" & "2 DB BEs\Champ 22_sales_beeee.accdb" ' Define target file name.
FileCopy SourceFile, DestinationFile
End Sub
Public Sub Test0()
Dim SourceFile, DestinationFile
SourceFile = CurrentProject.Path & "\" & "2 DB BEs\Champ 22_sales_be.accdb" ' Define source file name.
DestinationFile = CurrentProject.Path & "\" & "2 DB BEs\Champ 22_sales_beeee.accdb" ' Define target file name.
FileCopy SourceFile, DestinationFile
End Sub