VBScript - VB Script in DTS - Else Elseif
VBScript - VB Script in DTS: "Im trying to use ActiveX within a DTS package. What I'm trying to do is us bit of simply VBScript to transmit data from one data source to another.
Example:
Function Main()
IF
DTSSource('Type') = 1
Then
DTSDestination('Type') = 'P1'
Else
DTSDestination('Type') = 'Other'
End If
Main = DTSTransformStat_OK
End Function
However this doesnt seem to work. Can anyone explain why this might be.
Cheers
Tek-Tips Forums is Member Supported. Click Here to donate.
mrmovie (TechnicalUser)14 Dec 05 6:22
can you confirm that
DTSSource('Type') actually returns something you can convert to a string?
this DTSSource('Type') statement doesnt make any sense to me.
if doesnt look like you pass anything to your function and your function appears to return something which isnt defined within the function, again i am not sure i understand this
NotSQL (TechnicalUser)14 Dec 05 6:28
Its ok i've got it to work... Thanks Though.
IF DTSSource('Type') = 1 Then
DTSDestination('Type') = 'P1'
Elseif DTSSource('Type') = 2 Then
DTSDestination('Type') = 'P2'
Elseif DTSSource('Type') = 3 Then
DTSDestination('Type') = 'P3'
Elseif DTSSource('Type') = 4 Then
DTSDestination('Type') = 'P4'
Elseif DTSSource('Type') = 5 Then
DTSDestination('Type')"
Example:
Function Main()
IF
DTSSource('Type') = 1
Then
DTSDestination('Type') = 'P1'
Else
DTSDestination('Type') = 'Other'
End If
Main = DTSTransformStat_OK
End Function
However this doesnt seem to work. Can anyone explain why this might be.
Cheers
Tek-Tips Forums is Member Supported. Click Here to donate.
mrmovie (TechnicalUser)14 Dec 05 6:22
can you confirm that
DTSSource('Type') actually returns something you can convert to a string?
this DTSSource('Type') statement doesnt make any sense to me.
if doesnt look like you pass anything to your function and your function appears to return something which isnt defined within the function, again i am not sure i understand this
NotSQL (TechnicalUser)14 Dec 05 6:28
Its ok i've got it to work... Thanks Though.
IF DTSSource('Type') = 1 Then
DTSDestination('Type') = 'P1'
Elseif DTSSource('Type') = 2 Then
DTSDestination('Type') = 'P2'
Elseif DTSSource('Type') = 3 Then
DTSDestination('Type') = 'P3'
Elseif DTSSource('Type') = 4 Then
DTSDestination('Type') = 'P4'
Elseif DTSSource('Type') = 5 Then
DTSDestination('Type')"
0 Comments:
Post a Comment
<< Home