![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |