Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
humanpuck
Yak Posting Veteran
94 Posts |
Posted - 2006-07-25 : 11:44:53
|
Hi Folks,I have the following ActiveX script that I run at the end of my DTS package which renames the source file...'**********************************************************************' Visual Basic ActiveX Script'************************************************************************Function Main() Dim oFSO Dim oSourceFile Set oFSO = CreateObject("Scripting.FileSystemObject") Set oSourceFile = oFSO.GetFile("\\Ny\Daily_reports\Daily01.xls") sSourceFileRename = "\\ny\Daily_reports\" & Year(Date) & Month(Date) & Day(Date) & ".xls" oFSO.MoveFile oSourceFile, sSourceFileRename Set oFSO = Nothing End Function...The script works and it renames the file but the following error shows up "Invalid Task Result Value." So the package works, so does the script, but I can't get rid of this stupid error. Any ideas? |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2006-07-25 : 17:56:08
|
You need to explicitly return a value from the function:Main = DTSTaskExecResult_SuccessHTH,Tim |
|
|
humanpuck
Yak Posting Veteran
94 Posts |
Posted - 2006-07-27 : 08:36:26
|
This worked...thanks Tim. |
|
|
|
|
|