7 replies
by sl-campbell
Is the MDB opened exclusively or shared? If the first, then open it Shared instead.
I am tracking this so if it still doesn't work the post a comment to your question and not to my answer.
by sl-campbell
I doubt if this will help- the FileCopy is based off of this API There are no constants to force a copy because the file is obviously locked by another process and Windows will not allow a copy on protected files-The API function to copy files is asfollows:
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Type SHFILEOPSTRUCT
wFunc As Long
pFrom As String
pTo As String
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As Long
End Type
Public Const FOF_NOCONFIRMATION = &H10
Public Sub API_CopyFile(ByVal sFileFrom As String, ByVal sFileTo As String, Optional ByVal bNoDelConfirm As Boolean = False)
Const FO_COPY = &H2
Const FOF_SILENT = &H4
Dim lReturn As Long
Dim SHop As SHFILEOPSTRUCT
On Error Resume Next
With SHop
.wFunc = FO_COPY
.pFrom = sFileFrom
.pTo = sFileTo
If bNoDelConfirm Then .fFlags = .fFlags + FOF_NOCONFIRMATION
End With
lReturn = SHFileOperation(SHop)
End Sub
by keith at anw
by keith at anw
Perahps the problem is with the FileCopy function - it tries to open file exclusively when copying it...I cant remember now Windows function for file copy but you can execute the bat file with ShellExecute (WinAPI)
Regards,
Bojidar Alexandrov
by keith at anw
by keith at anw
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending