dbTalk Databases Forums  

What's wrong with my ActiveX Script Task Syntax?

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


Discuss What's wrong with my ActiveX Script Task Syntax? in the microsoft.public.sqlserver.dts forum.



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

Default What's wrong with my ActiveX Script Task Syntax? - 12-13-2004 , 08:17 PM






The specific line which is failing is

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

The error I'm getting is Object doesn't support this Property or Method
'Tsk.DestinationDatabase'

I don't get this. I've looked in the disconnected editor and I can see that
this Task most definitely does have a DestinationDatabase property. I know
I'm picking up the right task in my code, because the second MsgBox is just
a debug output which outputs the task description so I know I've got the
right task object.

What am I doing wrong?

Thanks very much for your help!

- Joe Geretz -

Function Main()

Dim Return
Dim Pkg
Dim Tsk

Return = MsgBox("Do you want to overwrite " &
DTSGlobalVariables("SQLTarget").Value & "?", vbYesNo , "Confirm Target")

If Return = vbNo Then
Main = DTSTaskExecResult_Failure
Exit Function
End If

Set Pkg = DTSGlobalVariables.Parent
Set Tsk = Pkg.Tasks("InitTarget")

' This is a debug message. Shows I'm picking up the right Task
MsgBox "Task InitTarget: " & Tsk.Description, , "Debug"

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

Main = DTSTaskExecResult_Success

End Function



Reply With Quote
  #2  
Old   
Joseph Geretz
 
Posts: n/a

Default Re: What's wrong with my ActiveX Script Task Syntax? - 12-13-2004 , 08:43 PM






Uh Oh,

I'm starting to realize that DestinationDatabase is a property of the
TransferObjectsTask interface, rather than the Task interface. So how do I
get ahold of this interface in my VBScript?

I apologize if this is an elementary questions. I'm a VB guy, but I haven't
done a lot of VBScripting.

Thanks for your help!

Joe Geretz

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote

Quote:
The specific line which is failing is

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

The error I'm getting is Object doesn't support this Property or Method
'Tsk.DestinationDatabase'

I don't get this. I've looked in the disconnected editor and I can see
that this Task most definitely does have a DestinationDatabase property. I
know I'm picking up the right task in my code, because the second MsgBox
is just a debug output which outputs the task description so I know I've
got the right task object.

What am I doing wrong?

Thanks very much for your help!

- Joe Geretz -

Function Main()

Dim Return
Dim Pkg
Dim Tsk

Return = MsgBox("Do you want to overwrite " &
DTSGlobalVariables("SQLTarget").Value & "?", vbYesNo , "Confirm Target")

If Return = vbNo Then
Main = DTSTaskExecResult_Failure
Exit Function
End If

Set Pkg = DTSGlobalVariables.Parent
Set Tsk = Pkg.Tasks("InitTarget")

' This is a debug message. Shows I'm picking up the right Task
MsgBox "Task InitTarget: " & Tsk.Description, , "Debug"

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

Main = DTSTaskExecResult_Success

End Function





Reply With Quote
  #3  
Old   
Joseph Geretz
 
Posts: n/a

Default Re: What's wrong with my ActiveX Script Task Syntax? - 12-13-2004 , 09:49 PM



The only way this can be done is with a Dynamic Properties task?

I got this to work. I stripped down my ActiveX task to the following:

Function Main()

Dim Return

Return = MsgBox("Do you want to overwrite " &
DTSGlobalVariables("SQLTarget").Value & "?", vbYesNo , "Confirm Target")

If Return = vbNo Then
Main = DTSTaskExecResult_Failure
Else
Main = DTSTaskExecResult_Success
End If

End Function

Then I created a Dynamic Properties task which is contingent on the success
of the ActiveX task.

Is this the only way to do this?

Thanks,

Joe Geretz

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote

Quote:
Uh Oh,

I'm starting to realize that DestinationDatabase is a property of the
TransferObjectsTask interface, rather than the Task interface. So how do I
get ahold of this interface in my VBScript?

I apologize if this is an elementary questions. I'm a VB guy, but I
haven't done a lot of VBScripting.

Thanks for your help!

Joe Geretz

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote in message
news:%23pVcMMY4EHA.2156 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
The specific line which is failing is

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

The error I'm getting is Object doesn't support this Property or Method
'Tsk.DestinationDatabase'

I don't get this. I've looked in the disconnected editor and I can see
that this Task most definitely does have a DestinationDatabase property.
I know I'm picking up the right task in my code, because the second
MsgBox is just a debug output which outputs the task description so I
know I've got the right task object.

What am I doing wrong?

Thanks very much for your help!

- Joe Geretz -

Function Main()

Dim Return
Dim Pkg
Dim Tsk

Return = MsgBox("Do you want to overwrite " &
DTSGlobalVariables("SQLTarget").Value & "?", vbYesNo , "Confirm Target")

If Return = vbNo Then
Main = DTSTaskExecResult_Failure
Exit Function
End If

Set Pkg = DTSGlobalVariables.Parent
Set Tsk = Pkg.Tasks("InitTarget")

' This is a debug message. Shows I'm picking up the right Task
MsgBox "Task InitTarget: " & Tsk.Description, , "Debug"

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

Main = DTSTaskExecResult_Success

End Function







Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: What's wrong with my ActiveX Script Task Syntax? - 12-14-2004 , 01:45 AM



Task is a like a wrapper. From there you get a reference to the type
specifici class through teh CustomTask Property.

Changing the DataPump Source and Destination Tables
(http://www.sqldts.com/default.aspx?213)

The key line for you is probably -

Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask



--
Darren Green
http://www.sqldts.com

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote

Quote:
Uh Oh,

I'm starting to realize that DestinationDatabase is a property of the
TransferObjectsTask interface, rather than the Task interface. So how do I
get ahold of this interface in my VBScript?

I apologize if this is an elementary questions. I'm a VB guy, but I
haven't
done a lot of VBScripting.

Thanks for your help!

Joe Geretz

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote in message
news:%23pVcMMY4EHA.2156 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
The specific line which is failing is

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

The error I'm getting is Object doesn't support this Property or Method
'Tsk.DestinationDatabase'

I don't get this. I've looked in the disconnected editor and I can see
that this Task most definitely does have a DestinationDatabase property.
I
know I'm picking up the right task in my code, because the second MsgBox
is just a debug output which outputs the task description so I know I've
got the right task object.

What am I doing wrong?

Thanks very much for your help!

- Joe Geretz -

Function Main()

Dim Return
Dim Pkg
Dim Tsk

Return = MsgBox("Do you want to overwrite " &
DTSGlobalVariables("SQLTarget").Value & "?", vbYesNo , "Confirm Target")

If Return = vbNo Then
Main = DTSTaskExecResult_Failure
Exit Function
End If

Set Pkg = DTSGlobalVariables.Parent
Set Tsk = Pkg.Tasks("InitTarget")

' This is a debug message. Shows I'm picking up the right Task
MsgBox "Task InitTarget: " & Tsk.Description, , "Debug"

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

Main = DTSTaskExecResult_Success

End Function







Reply With Quote
  #5  
Old   
Joseph Geretz
 
Posts: n/a

Default Re: What's wrong with my ActiveX Script Task Syntax? - 12-14-2004 , 11:15 PM



Thanks!

- Joe Geretz -

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
Task is a like a wrapper. From there you get a reference to the type
specifici class through teh CustomTask Property.

Changing the DataPump Source and Destination Tables
(http://www.sqldts.com/default.aspx?213)

The key line for you is probably -

Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask



--
Darren Green
http://www.sqldts.com

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote in message
news:%23iwgHbY4EHA.3504 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Uh Oh,

I'm starting to realize that DestinationDatabase is a property of the
TransferObjectsTask interface, rather than the Task interface. So how do
I
get ahold of this interface in my VBScript?

I apologize if this is an elementary questions. I'm a VB guy, but I
haven't
done a lot of VBScripting.

Thanks for your help!

Joe Geretz

"Joseph Geretz" <jgeretz (AT) nospam (DOT) com> wrote in message
news:%23pVcMMY4EHA.2156 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
The specific line which is failing is

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

The error I'm getting is Object doesn't support this Property or Method
'Tsk.DestinationDatabase'

I don't get this. I've looked in the disconnected editor and I can see
that this Task most definitely does have a DestinationDatabase
property.
I
know I'm picking up the right task in my code, because the second
MsgBox
is just a debug output which outputs the task description so I know
I've
got the right task object.

What am I doing wrong?

Thanks very much for your help!

- Joe Geretz -

Function Main()

Dim Return
Dim Pkg
Dim Tsk

Return = MsgBox("Do you want to overwrite " &
DTSGlobalVariables("SQLTarget").Value & "?", vbYesNo , "Confirm
Target")

If Return = vbNo Then
Main = DTSTaskExecResult_Failure
Exit Function
End If

Set Pkg = DTSGlobalVariables.Parent
Set Tsk = Pkg.Tasks("InitTarget")

' This is a debug message. Shows I'm picking up the right Task
MsgBox "Task InitTarget: " & Tsk.Description, , "Debug"

Tsk.DestinationDatabase = DTSGlobalVariables("SQLTarget").Value

Main = DTSTaskExecResult_Success

End Function









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.