![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I am trying to write a vb script that would check not one but the existence of two files before it goes into the next dtstask. I tried to use dtsglobalvariables, but is the same problem as if i have before with the function below: Function Main() Main = CheckFile(FILE1,FILE2) End Function Function CheckFile(sFileName1, sFileName2) Dim fso Set fso = CreateObject ("Scripting.FileSystemObject") If (fso.FileExists(sFileName1,sFileName2)) Then CheckFile = DTSTaskExecResult_Success Else CheckFile = DTSTaskExecResult_Failure End If Set fso = Nothing End Function This does not work, I got an error on the vb script dtstask, any help is very welcome!!! thanks |
#3
| |||
| |||
|
|
Hello, I am trying to write a vb script that would check not one but the existence of two files before it goes into the next dtstask. I tried to use dtsglobalvariables, but is the same problem as if i have before with the function below: Function Main() Main = CheckFile(FILE1,FILE2) End Function Function CheckFile(sFileName1, sFileName2) Dim fso Set fso = CreateObject ("Scripting.FileSystemObject") If (fso.FileExists(sFileName1,sFileName2)) Then CheckFile = DTSTaskExecResult_Success Else CheckFile = DTSTaskExecResult_Failure End If Set fso = Nothing End Function This does not work, I got an error on the vb script dtstask, any help is very welcome!!! thanks |
#4
| |||
| |||
|
|
-----Original Message----- If you check the syntax for FileExists it only accepts one parameter. http://msdn.microsoft.com/library/default.asp? url=/library/en-us/script56/html/jsmthfileexists.asp Function CheckFile(sFileName1, sFileName2) Dim fso Set fso = CreateObject ("Scripting.FileSystemObject") If fso.FileExists(sFileName1) And fso.FileExists (sFileName2) Then CheckFile = DTSTaskExecResult_Success Else CheckFile = DTSTaskExecResult_Failure End If Set fso = Nothing End Function -- Darren Green http://www.sqldts.com "martino" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:476801c49087$f011a750$a501280a (AT) phx (DOT) gbl... Hello, I am trying to write a vb script that would check not one but the existence of two files before it goes into the next dtstask. I tried to use dtsglobalvariables, but is the same problem as if i have before with the function below: Function Main() Main = CheckFile(FILE1,FILE2) End Function Function CheckFile(sFileName1, sFileName2) Dim fso Set fso = CreateObject ("Scripting.FileSystemObject") If (fso.FileExists(sFileName1,sFileName2)) Then CheckFile = DTSTaskExecResult_Success Else CheckFile = DTSTaskExecResult_Failure End If Set fso = Nothing End Function This does not work, I got an error on the vb script dtstask, any help is very welcome!!! thanks . |
#5
| |||
| |||
|
|
it works beautifully!! thanks a lot Darren, Allan -----Original Message----- If you check the syntax for FileExists it only accepts one parameter. http://msdn.microsoft.com/library/default.asp? url=/library/en-us/script56/html/jsmthfileexists.asp Function CheckFile(sFileName1, sFileName2) Dim fso Set fso = CreateObject ("Scripting.FileSystemObject") If fso.FileExists(sFileName1) And fso.FileExists (sFileName2) Then CheckFile = DTSTaskExecResult_Success Else CheckFile = DTSTaskExecResult_Failure End If Set fso = Nothing End Function -- Darren Green http://www.sqldts.com "martino" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:476801c49087$f011a750$a501280a (AT) phx (DOT) gbl... Hello, I am trying to write a vb script that would check not one but the existence of two files before it goes into the next dtstask. I tried to use dtsglobalvariables, but is the same problem as if i have before with the function below: Function Main() Main = CheckFile(FILE1,FILE2) End Function Function CheckFile(sFileName1, sFileName2) Dim fso Set fso = CreateObject ("Scripting.FileSystemObject") If (fso.FileExists(sFileName1,sFileName2)) Then CheckFile = DTSTaskExecResult_Success Else CheckFile = DTSTaskExecResult_Failure End If Set fso = Nothing End Function This does not work, I got an error on the vb script dtstask, any help is very welcome!!! thanks . |
![]() |
| Thread Tools | |
| Display Modes | |
| |