Discussion:
ActiveX -> VB.Net Scripttask
(too old to reply)
Joachim Hofmann
2009-11-27 15:19:43 UTC
Permalink
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
Todd C
2009-12-03 13:10:01 UTC
Permalink
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
Post by Joachim Hofmann
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
.
Joachim Hofmann
2009-12-30 16:40:10 UTC
Permalink
Post by Todd C
SSIS packages are really for un-attended operation. That being said, you CAN
*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.
Post by Todd C
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

Loading...