dbTalk Databases Forums  

ActiveX -> VB.Net Scripttask

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


Discuss ActiveX -> VB.Net Scripttask in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joachim Hofmann
 
Posts: n/a

Default ActiveX -> VB.Net Scripttask - 11-27-2009 , 09:19 AM






Hello,

I migrated a DTS-Package to SSIS.
There is an ActiveX-Task in vbscript I d like to rewrite in a new VB.Net Scripttask.
The task sets the datasource of flatfile connections dynamically by prompting the user and setting
the datasource property.

Set oPackage = DTSGlobalVariables.parent
...
strPromptedPath = InputBox ("Where are the files?", "Import Post-CD")
...
oPackage.connections("PostCDDatei_XX").Datasource = strPromptedPath & "\myfile.txt"


How would I do this in a VB.Net Scripttask for this?

Are there some other references around for programming a Scripttask for SSIS and the SSIS
programmable objects in general?

Thank You

Joachim

Reply With Quote
  #2  
Old   
Todd C
 
Posts: n/a

Default RE: ActiveX -> VB.Net Scripttask - 12-03-2009 , 07:10 AM






TIME OUT!
"prompt the user" ?
INSIDE an SSIS package?
Are you serious?

That kind of like installing a cabbie's meter box in a dump truck. Yeah, you
could do it, but WHY?

SSIS packages are really for un-attended operation. That being said, you CAN
direct the package from external sources such as:
*Configuration files, databases, environment variables, and parent package
variables
*Using the /SET switch with DTExec command line utility
*Instantiate the package execution progamatically by wrapping it in code
(something I have not personally done but know that you have an entire object
model available in VB for).

Joachim: O hope you'r not offended by my attempt at humor in the openning
lines. But seriously, I wouldn't program into a package anything that stops
and prompts the user for input.
Consider this scenario: You now have to process 100 flat files instead of
just one. Will your user want to type in the path 100 times? What if that
list of files was stored in a way that a VB app could get to it? The VB could
just iterate over the list, passing a new value in to a Package Property
(like a flat file Connection String) each time and NOT have to query the user
for it.

Good Luck. Hope this helps!
=====
Todd C


"Joachim Hofmann" wrote:

Quote:
Hello,

I migrated a DTS-Package to SSIS.
There is an ActiveX-Task in vbscript I d like to rewrite in a new VB.Net Scripttask.
The task sets the datasource of flatfile connections dynamically by prompting the user and setting
the datasource property.

Set oPackage = DTSGlobalVariables.parent
...
strPromptedPath = InputBox ("Where are the files?", "Import Post-CD")
...
oPackage.connections("PostCDDatei_XX").Datasource = strPromptedPath & "\myfile.txt"


How would I do this in a VB.Net Scripttask for this?

Are there some other references around for programming a Scripttask for SSIS and the SSIS
programmable objects in general?

Thank You

Joachim
.

Reply With Quote
  #3  
Old   
Joachim Hofmann
 
Posts: n/a

Default Re: ActiveX -> VB.Net Scripttask - 12-30-2009 , 10:40 AM



Todd C wrote:


Quote:
SSIS packages are really for un-attended operation. That being said, you CAN
direct the package from external sources such as:
*Configuration files, databases, environment variables, and parent package
variables
*Using the /SET switch with DTExec command line utility
*Instantiate the package execution progamatically by wrapping it in code
(something I have not personally done but know that you have an entire object
model available in VB for).

You may be right, but in this case it is only a package which is run by myself 4 times a year.
So no further expenditure is needed.

Quote:
Joachim: O hope you'r not offended by my attempt at humor in the openning
lines. But seriously, I wouldn't program into a package anything that stops

Consider this scenario: You now have to process 100 flat files instead of
just one. Will your user want to type in the path 100 times?
No, it is just the path of the files, all the files are in the same directory.

I found VB.Net code in the MSDN which replaced the Vbscript code.

Thank You

Joachim

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.