dbTalk Databases Forums  

ActiveX Connection Change Attempt

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


Discuss ActiveX Connection Change Attempt in the microsoft.public.sqlserver.dts forum.



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

Default ActiveX Connection Change Attempt - 10-21-2004 , 12:17 PM






I am attempting to change the properties of a connection that is used by a
generic sql task. I have coded to change the Database/Server as shown below.
But the tasks that use this connection don't seem to recognize the change
and run against the initial Databaser/Server. Is there something missing
that forces sort of refresh within the object?

Function Main()
Dim oPkg
Dim oConn
Dim stpBeginMe

'Get package object
set oPkg = DTSGlobalVariables.Parent

'Get Connection object
set oConn = oPkg.connections("Variable Connection")

oConn.Catalog = DTSGlobalVariables("OMS_Name").Value
oConn.DataSource = DTSGlobalVariables("OMS_Server").Value

set oConn = nothing
set oPkg = nothing

Main =DTSTaskExecResult_Success
End Function

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: ActiveX Connection Change Attempt - 10-21-2004 , 03:16 PM






Make sure the Onject names in your Transform tasks are not 3 parters.
Change them to just

<owner>.<name>

Also make sure each task is set to "Close connection on completion" in the
workflow properties

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"whornak" <whornak (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am attempting to change the properties of a connection that is used by a
generic sql task. I have coded to change the Database/Server as shown
below.
But the tasks that use this connection don't seem to recognize the change
and run against the initial Databaser/Server. Is there something missing
that forces sort of refresh within the object?

Function Main()
Dim oPkg
Dim oConn
Dim stpBeginMe

'Get package object
set oPkg = DTSGlobalVariables.Parent

'Get Connection object
set oConn = oPkg.connections("Variable Connection")

oConn.Catalog = DTSGlobalVariables("OMS_Name").Value
oConn.DataSource = DTSGlobalVariables("OMS_Server").Value

set oConn = nothing
set oPkg = nothing

Main =DTSTaskExecResult_Success
End Function



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.