July 5, 2006 at 7:03 pm
I am trying to setup an ActiveX task that asks the user for a table name and then sets the SQLStatement of an ExecuteSQLTask2 task. THe basic idea is to ask for the name of a table and then delete all records from that table.
The problem is that when I run this, I get a VBScript error that the "Object doesn't support this property or method".
Here is the script.
Function Main()
Dim TableName
Dim oPKG
Dim oTSK
Set oPKG = DTSGlobalVariables.Parent
Set oTSK = oPKG.Tasks("DTSTask_DTSExecuteSQLTask_2")
TableName = UCase(inputbox("Enter the name of the table that will be processed."))
if len(TableName)=0 then
Main = DTSTaskExecResult_Failure
else
msgbox(otsk.SQLStatement)
oTSK.SQLStatement = "DELETE FROM " & TableName
Main = DTSTaskExecResult_Success
end if
End Function
Does anyone have any idea why I keep getting this error? The target task IS an ExecuteSQLTask2 and the name IS spelled correctly.
Any help would be appreciated. Thanks.
July 6, 2006 at 10:35 am
Use this instead:
Set oTSK = oPKG.Tasks("DTSTask_DTSExecuteSQLTask_2").CustomTask
July 6, 2006 at 11:40 am
Thank you Erik. That did the trick.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply