By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

Dts pkg problem in vb.net - OK vb6

P: n/a
Ron
Hello,

I can run a dts package in a vb6 app multiple times. If I
run the same package once in a vb.net project, it runs
fine (did all the dotnet syntax conversions...). If I try
to run the dts package multiple times in the vb.net
project the package fails (I have all the references to
DTS Com object library, DTS com DataPump, DTS tasks). I
ran the package in vb.net from a standard module. I can
only run the package once that way and then need to
restart the app/project to re-set something in dts. So I
put the dts package code in a project class module. Now I
can run the package multiple times except...I want to
import several text files to Sql Server. If I loop
through the collection of text files once, dts is OK.
Loop through it again, dts is OK. But if I click my "Run
DTS" button a third time, the dts package class (my custom
class) fails. Error message says something
about "Exception - calling a virutal function..."

In the VB6 app, the dts package runs fine right straight
from the standard module. I can loop through it to my
heart's content. I would really desire to not have to
call a vb6.exe from my vb.net project if I can help it to
run the dts package. Surely, if I can manipulate DTS in
vb6 - it should be doable in vb.net in the same manner.
Any suggestions greatly appreciated what else I could try.

Thanks,
Ron
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ron
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-----
Hello,

I can run a dts package in a vb6 app multiple times. If Irun the same package once in a vb.net project, it runs
fine (did all the dotnet syntax conversions...). If I tryto run the dts package multiple times in the vb.net
project the package fails (I have all the references to
DTS Com object library, DTS com DataPump, DTS tasks). I
ran the package in vb.net from a standard module. I can
only run the package once that way and then need to
restart the app/project to re-set something in dts. So I
put the dts package code in a project class module. Now Ican run the package multiple times except...I want to
import several text files to Sql Server. If I loop
through the collection of text files once, dts is OK.
Loop through it again, dts is OK. But if I click my "Run
DTS" button a third time, the dts package class (my customclass) fails. Error message says something
about "Exception - calling a virutal function..."

In the VB6 app, the dts package runs fine right straight
from the standard module. I can loop through it to my
heart's content. I would really desire to not have to
call a vb6.exe from my vb.net project if I can help it to
run the dts package. Surely, if I can manipulate DTS in
vb6 - it should be doable in vb.net in the same manner.
Any suggestions greatly appreciated what else I could try.

Thanks,
Ron
.

Nov 21 '05 #2

P: n/a
Ron
One more note: goPackage...Remove goes before
goPackage.UnInitialize. And also, keep the Module/class
level goPackage vars private. This is for when you have
to call the dts package multiple times while the
app/project is running.

-----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-----
Hello,

I can run a dts package in a vb6 app multiple times. If
I
run the same package once in a vb.net project, it runs
fine (did all the dotnet syntax conversions...). If Itry
to run the dts package multiple times in the vb.net
project the package fails (I have all the references to
DTS Com object library, DTS com DataPump, DTS tasks).

Iran the package in vb.net from a standard module. I canonly run the package once that way and then need to
restart the app/project to re-set something in dts. So Iput the dts package code in a project class module. NowI
can run the package multiple times except...I want to
import several text files to Sql Server. If I loop
through the collection of text files once, dts is OK.
Loop through it again, dts is OK. But if I click

my "RunDTS" button a third time, the dts package class (my

custom
class) fails. Error message says something
about "Exception - calling a virutal function..."

In the VB6 app, the dts package runs fine right straightfrom the standard module. I can loop through it to my
heart's content. I would really desire to not have to
call a vb6.exe from my vb.net project if I can help it torun the dts package. Surely, if I can manipulate DTS invb6 - it should be doable in vb.net in the same manner.Any suggestions greatly appreciated what else I could try.
Thanks,
Ron
.

.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.