Hi,
I'm having a bit of a problem with the above. I need to access a remote server, pick up an image and dump it back onto my local server. However, the folder on the remote server has a space in the filename which seems to stop the pathe being recognised! Any ideas for a workaround/fix? Here's the code that doesn't work:
Replacing strFileToCopy with "\\lds-1101\Data\Test.tif" works, hence I think it's the space causing the problem.
Thanks, Iain
I'm having a bit of a problem with the above. I need to access a remote server, pick up an image and dump it back onto my local server. However, the folder on the remote server has a space in the filename which seems to stop the pathe being recognised! Any ideas for a workaround/fix? Here's the code that doesn't work:
Code:
'============================
'Move the files to our server
'============================
dim fs as FileSystemObject
dim fl as File
dim rst as DAO.Recordset
dim strPRPData as String
dim strSaveFolder as String
strSaveFolder = "P:\Shared\insolvency\ForwardFlow\TestTiffs\"
strPRPData = "SELECT Case.CaseID, tblDWFExtractData.ProposalFileName, Case.PNumber " & _
"FROM [Case] INNER JOIN tblDWFExtractData ON Case.PNumber = tblDWFExtractData.PNumber; "
Set rst = dbs.OpenRecordset(strPRPData, dbOpenDynaset, dbSeeChanges)
rst.MoveFirst
Set fs = New FileSystemObject
Do Until rst.EOF
strFileToCopy = "\\lds-1101\Document Output\" & rst("CaseID") & "\" & Right(rst("ProposalFileName"), Len(rst("ProposalFileName")) - 2)
'***Breaks here with 'file not found' error***
Set fl = fs.GetFile(strFileToCopy)
' Set fl = fs.GetFile(strFileToCopy)
fl.Copy (strSaveFolder)
rst.MoveNext
Loop
'etc...
Replacing strFileToCopy with "\\lds-1101\Data\Test.tif" works, hence I think it's the space causing the problem.
Thanks, Iain