dbTalk Databases Forums  

Setting DSN of connection object 2nd time in package doesn't work

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


Discuss Setting DSN of connection object 2nd time in package doesn't work in the microsoft.public.sqlserver.dts forum.



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

Default Setting DSN of connection object 2nd time in package doesn't work - 05-11-2006 , 02:33 PM






Hi:

I posted another thread but I figured out what the problem is.

I use a loop that sets the source connection object each time at the
beginning of each loop to a different DSN-each DSN points towards a
different server with the same database structure (I set this through
an ActiveX script task, setting the
"pkg.Connections("My_Source_Conn_Name").DataSource " property). I then
run a series of datapump tasks that should use the new DSN each time.
This is not a problem with the loop, it is clearly looping through each
set of steps each time.

I realized that the second time I set it, it doesn't take, i.e. the
datapump tasks all run off of the first DSN setting. Each time through
the loop the queries run from the first server as if the source
connection object had not been changed. If I use a:

msgbox "DSN is now: " &
pkg.Connections("My_Source_Conn_Name").DataSource

before and after when I set it in the ActiveX task, it tells me I am
doing it correctly-it changes each time.

If I look at the Source Connection object when the package is done, it
is set correctly to the last server's DSN. If I do an "execute step" at
that point it works and gets the data from the last server.

Every step in the package is set to run based on the success of the
previous step, but it is like the source connection object is not
getting set until the end of the package, at least as far as the
DataPump tasks are concerned. How can I ensure it gets set before each
next set of DataPump tasks?

This is urgent for me, so I greatly appreciate any help. Let me know if
you need more info.

Thanks,
Kayda


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.