dbTalk Databases Forums  

Idiots Guide Needed - DTS Custom Tasks

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


Discuss Idiots Guide Needed - DTS Custom Tasks in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter Newman
 
Posts: n/a

Default Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 07:16 AM






Im really stuck on this and its a major part of the entire DTS. I have a task ( acticex dll written in vb6), which is registered using the register custom tasks option in the DTS Designer

I have three String ( varchar ) properties for this task ( name, infile & outfile ), which i can manually inseret data to and the task will complete fine. What i am looking to do is be able to set the properties of the 'custom' task from an ActiveX task.

Is this possible ? and if so are there any examples i can look a

Thanks for any help with this

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 07:45 AM






What about


dim tsk

set tsk = DTSGlobalVariables.Parent.Tasks("Name of task").CustomTask

tsk.Properties("Name of property").Value = XXXXX





"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Im really stuck on this and its a major part of the entire DTS. I have a
task ( acticex dll written in vb6), which is registered using the register
custom tasks option in the DTS Designer.
Quote:
I have three String ( varchar ) properties for this task ( name, infile &
outfile ), which i can manually inseret data to and the task will complete
fine. What i am looking to do is be able to set the properties of the
'custom' task from an ActiveX task.
Quote:
Is this possible ? and if so are there any examples i can look at

Thanks for any help with this



Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 08:18 AM



That's becausea you are specifying the name of the step

Sub

DTSStep_ConvertFileForSQL.ClsConvert_1

For

DTSTask_ConvertFileForSQL.ClsConvert_1


"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,

Ive tried that but keep comming up with the error that the Task was not
found.
Im not sure as to where im going wrong, if i look at the Workflow
properties of the task i get
"DTSStep_ConvertFileForSQL.ClsConvert_1"

How would i get the proper 'Task' name to ensure that im at least using
the correct details




Reply With Quote
  #4  
Old   
Peter Newman
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 08:36 AM



Alan

That did the trick as far as eliminating the error, but i now have a new one. on this line

tsk.Properties("Description").Value = "Hello World"

the error message = object doesnt support this property or method: tsk.Propertie


Reply With Quote
  #5  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 08:49 AM



Can you show me all code leading to that ?


"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,

That did the trick as far as eliminating the error, but i now have a new
one. on this line

tsk.Properties("Description").Value = "Hello World"

the error message = object doesnt support this property or method:
tsk.Properties




Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 09:08 AM



do not use the second SET

i didn't


"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,

The Active X task is below, its one im using to try and test this problem

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function MAIN()
dim tsk
set tsk =
DTSGlobalVariables.Parent.Tasks("DTSTask_ConvertFi leForSQL.ClsConvert_1").Cu
stomTask
Quote:
set tsk.Properties("NewOutputFileName").Value = "Hello World"
Main = DTSTaskExecResult_Success
End Function

If you need the coding for the vb6 activex dll let me know



Reply With Quote
  #7  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 09:33 AM



it should just be

tsk.Properties("Name").Value = "Value"




"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,

I tried it both ways, once with the second set and once without, same
result though

object doesnt support this property or method: Set tsk.Properties




Reply With Quote
  #8  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 09:58 AM



can you send me your dll (zipped)

Quick one though try removing the CustomTask from the end of the task
reference

Allan



"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,
i am using

tsk.Properties("NewOutputFileName").Value = "Hello World"

and still getting the same error message. I am at a loss as to why or
what to do to rectify this. Is is a SQL/DTS setup problem or a VB6 ActiveX
problem. If i submit the code would that help in tracking this down




Reply With Quote
  #9  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Idiots Guide Needed - DTS Custom Tasks - 05-14-2004 , 11:09 AM



The address I use on the NG - no-spam


"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,

Just got home, give me a min to try out the last suggestion, if that
doesnt work where should i send this zipp file to ?




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.