Just for reference, I think I came up with a solution.
YOu have to remove 2 connections which get added during
the execution of the dts package, you have to remove 1
step and you have to remove 1 task.
at the end of sub main (or could be called sub runDTS)
add this:
goPackage.Connections.Remove(2)
goPackage.Connections.Remove(1)
goPackage.Steps.Remove(1)
goPackage.Tasks.Remove(1)
[quoted text, click to view] >-----Original Message-----
>Nope. Still crashing. If I loop through a collections
of
>text files (3 text files right now) and instantiate my
>custom dts class for each text file, the procedure runs
>fine the first time, and even the 2nd time. But the
third
>time I invoke the procedure, I get a variety of
>erros, "Copy ... failed", "can't find the
>package...", "Access violation"
>
>Something is not being reset or emptied out. Any
>suggestions appreciated.
>
>
>>-----Original Message-----
>>I think I found a solution. I placed all of the DTS
>>Module code into a class and invoke the class object,
run
>>the dts code and set the class object to nothing. Then
I
>>can re-run the class object as many times as I want.
>This
>>seems to work.
>>
>>>-----Original Message-----
>>>Hello again,
>>>
>>>So, in my vb.net app I run a DTS package from a
button.
>>>No problem the first time. But if I click the same
>>button
>>>to run the same package, I get an error message that a
>>>connection already exists. So I added an If statement
>>>with a static integer var.
>>>
>>>If var < 1 then
>>>goPackage.Connections.Add(...)
>>>End If
>>>i += 1
>>>
>>>
>>>But then I get an error at
>>>
>>> CType(goPackage, DTS.Package).Tasks.Add(oTask)
>>>
>>>So I do the If var < 1 then ...
>>>
>>>Then I get an error than some transformation thing
needs
>>>to be specified. So, is it possible to re-run a DTS
>>>package from a VB app without restarting the app?
>>>Obviously something need to be reset to Nothing. How
>can
>>>I re-run a DTS package in my app?
>>>
>>>Thanks,
>>>Ron
>>>.
>>>
>>.
>>
>.
One more note: goPackage...Remove goes before
goPackage.UnInitialize. And also, keep the Module level
goPackage vars private. This is for when you have to
call the dts package multiple times while the app/project
is running.
[quoted text, click to view] >-----Original Message-----
>Just for reference, I think I came up with a solution.
>YOu have to remove 2 connections which get added during
>the execution of the dts package, you have to remove 1
>step and you have to remove 1 task.
>
>at the end of sub main (or could be called sub runDTS)
>add this:
>
>goPackage.Connections.Remove(2)
>goPackage.Connections.Remove(1)
>goPackage.Steps.Remove(1)
>goPackage.Tasks.Remove(1)
>
>
>>-----Original Message-----
>>Nope. Still crashing. If I loop through a collections
>of
>>text files (3 text files right now) and instantiate my
>>custom dts class for each text file, the procedure runs
>>fine the first time, and even the 2nd time. But the
>third
>>time I invoke the procedure, I get a variety of
>>erros, "Copy ... failed", "can't find the
>>package...", "Access violation"
>>
>>Something is not being reset or emptied out. Any
>>suggestions appreciated.
>>
>>
>>>-----Original Message-----
>>>I think I found a solution. I placed all of the DTS
>>>Module code into a class and invoke the class object,
>run
>>>the dts code and set the class object to nothing.
Then
>I
>>>can re-run the class object as many times as I want.
>>This
>>>seems to work.
>>>
>>>>-----Original Message-----
>>>>Hello again,
>>>>
>>>>So, in my vb.net app I run a DTS package from a
>button.
>>>>No problem the first time. But if I click the same
>>>button
>>>>to run the same package, I get an error message that
a
>>>>connection already exists. So I added an If
statement
>>>>with a static integer var.
>>>>
>>>>If var < 1 then
>>>>goPackage.Connections.Add(...)
>>>>End If
>>>>i += 1
>>>>
>>>>
>>>>But then I get an error at
>>>>
>>>> CType(goPackage, DTS.Package).Tasks.Add(oTask)
>>>>
>>>>So I do the If var < 1 then ...
>>>>
>>>>Then I get an error than some transformation thing
>needs
>>>>to be specified. So, is it possible to re-run a DTS
>>>>package from a VB app without restarting the app?
>>>>Obviously something need to be reset to Nothing. How
>>can
>>>>I re-run a DTS package in my app?
>>>>
>>>>Thanks,
>>>>Ron
>>>>.
>>>>
>>>.
>>>
>>.
>>
>.
Don't see what you're looking for? Try a search.