Hi all,
I'm using the FSO in some of my DTS scripts. Everything seems to work fine, except that at the completion of the packages, I always get an error message in the final step, where I archive my source file(even though the steps to actually archive the source file complete successfully).
More info:
I've got several DTS packages that accept either .txt or .xls files as their source. These files are stored in a shared directory, and are placed there programatically via email and some other neat stuff. The files sit in the directory until the DTS packages are run. The data in the files is pumped into a SS2000 db, then the files are timestamped and moved to an archive directory, so as to make room for the next round of source files.
Everything works wonderfully, even the part where the files are moved to the archive, but I still get an error on the call to fso.MoveFile saying that the file can't be found, even though the files are getting renamed and moved successfully.
Here's a piece of my code:
Can anyone explain this to me? I've confirmed that the datestamping section has nothing to do with the error, by trying the script without that section.
As a reminder, the script works fine. File names are changed, files are moved, files are deleted, but I still get an error that the file doesn't exist upon package completion.
Thanks for any help,
Ryan
I'm using the FSO in some of my DTS scripts. Everything seems to work fine, except that at the completion of the packages, I always get an error message in the final step, where I archive my source file(even though the steps to actually archive the source file complete successfully).
More info:
I've got several DTS packages that accept either .txt or .xls files as their source. These files are stored in a shared directory, and are placed there programatically via email and some other neat stuff. The files sit in the directory until the DTS packages are run. The data in the files is pumped into a SS2000 db, then the files are timestamped and moved to an archive directory, so as to make room for the next round of source files.
Everything works wonderfully, even the part where the files are moved to the archive, but I still get an error on the call to fso.MoveFile saying that the file can't be found, even though the files are getting renamed and moved successfully.
Here's a piece of my code:
Code:
strFileName = "E:\SourceFiles\Doc.txt"
'MsgBox strFileName
dateString = thisDay & thisMonth & thisYear & thisHour & thisMin & thisSec
newFileName = left(strFileName, Instr(strFileName,".")-1)& "_" & dateString & ".txt"
newFileName = replace(newFileName,"SourceFiles","Archive")
'MsgBox newFileName
objFSO.MoveFile strFileName, newFileName
objFSO.DeleteFile strFileName
set objFSO = NOTHING
Can anyone explain this to me? I've confirmed that the datestamping section has nothing to do with the error, by trying the script without that section.
As a reminder, the script works fine. File names are changed, files are moved, files are deleted, but I still get an error that the file doesn't exist upon package completion.
Thanks for any help,
Ryan