dbTalk Databases Forums  

Error when running a DTS package - Invalid Task result value

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Error when running a DTS package - Invalid Task result value in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sonya
 
Posts: n/a

Default Error when running a DTS package - Invalid Task result value - 08-30-2005 , 03:01 PM






Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test


test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then

fs.DeleteFile path, True
End If
Main = DTSTaskExecResult_Success
next

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Error when running a DTS package - Invalid Task result value - 08-30-2005 , 03:10 PM






You have a function return value without the function here.

the "Main = DTSTaskExecResult_Success" needs to be inside the function



On Tue, 30 Aug 2005 13:01:09 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

Quote:
Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test


test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then

fs.DeleteFile path, True
End If
Main = DTSTaskExecResult_Success
next

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


Reply With Quote
  #3  
Old   
Sonya
 
Posts: n/a

Default Re: Error when running a DTS package - Invalid Task result value - 08-30-2005 , 05:26 PM



I moved that line inside the function and received the same error. I
originally had it commented out.
Any more ideas? Thanks for your response.

"Allan Mitchell" wrote:

Quote:
You have a function return value without the function here.

the "Main = DTSTaskExecResult_Success" needs to be inside the function



On Tue, 30 Aug 2005 13:01:09 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test


test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then

fs.DeleteFile path, True
End If
Main = DTSTaskExecResult_Success
next


Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Error when running a DTS package - Invalid Task result value - 08-30-2005 , 06:39 PM



And how does your function look now?

On Tue, 30 Aug 2005 15:26:02 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

Quote:
I moved that line inside the function and received the same error. I
originally had it commented out.
Any more ideas? Thanks for your response.

"Allan Mitchell" wrote:

You have a function return value without the function here.

the "Main = DTSTaskExecResult_Success" needs to be inside the function



On Tue, 30 Aug 2005 13:01:09 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test


test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then

fs.DeleteFile path, True
End If
Main = DTSTaskExecResult_Success
next


Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


Reply With Quote
  #5  
Old   
Sonya
 
Posts: n/a

Default Re: Error when running a DTS package - Invalid Task result value - 09-01-2005 , 11:03 AM



Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test
test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then
Main = DTSTaskExecResult_Success
fs.DeleteFile path, True
End If

next

"Allan Mitchell" wrote:

Quote:
And how does your function look now?

On Tue, 30 Aug 2005 15:26:02 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

I moved that line inside the function and received the same error. I
originally had it commented out.
Any more ideas? Thanks for your response.

"Allan Mitchell" wrote:

You have a function return value without the function here.

the "Main = DTSTaskExecResult_Success" needs to be inside the function



On Tue, 30 Aug 2005 13:01:09 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test


test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then

fs.DeleteFile path, True
End If
Main = DTSTaskExecResult_Success
next


Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


Reply With Quote
  #6  
Old   
Sonya
 
Posts: n/a

Default Re: Error when running a DTS package - Invalid Task result value - 09-01-2005 , 11:11 AM



I found where my error was located. Thanks Alan. I need to continue to test
the script.

"Sonya" wrote:

Quote:
Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test
test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then
Main = DTSTaskExecResult_Success
fs.DeleteFile path, True
End If

next

"Allan Mitchell" wrote:

And how does your function look now?

On Tue, 30 Aug 2005 15:26:02 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

I moved that line inside the function and received the same error. I
originally had it commented out.
Any more ideas? Thanks for your response.

"Allan Mitchell" wrote:

You have a function return value without the function here.

the "Main = DTSTaskExecResult_Success" needs to be inside the function



On Tue, 30 Aug 2005 13:01:09 -0700, "Sonya" <Sonya (AT) discussions (DOT) microsoft.com> wrote:

Function Main()


Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "C:\MSSQL\ExLogFiles\*.*"


End Function


Dim test


test = date()
path = "C:\MSSQL\ExLogFiles\"

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)

for each item in folder.Files
'd = DateAdd("D", -5, now() )
'msgbox d
' if item.DateLastModified < test and NDay < 5 Then
'if (item.DateLastModified) > test-5 AND item.DateLastModified < test Then
'if item.DateCreated < test AND (item.DateCreated) > test-5 Then
'if item.DateCreated < test AND (item.DateCreated) >d Then
if (item.DateLastModified) < test-0 then

fs.DeleteFile path, True
End If
Main = DTSTaskExecResult_Success
next


Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.