dbTalk Databases Forums  

Change dynamic properties with ActiveX

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


Discuss Change dynamic properties with ActiveX in the microsoft.public.sqlserver.dts forum.



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

Default Change dynamic properties with ActiveX - 04-11-2005 , 02:36 PM






Hello,
Instead of defining a dynamic property task in each DTS I rather would have
an ActiveX Script task changing the properties of a package.
1. Is this possible?
2. How is it done?
Thanks
Rene

Reply With Quote
  #2  
Old   
Peter
 
Posts: n/a

Default RE: Change dynamic properties with ActiveX - 04-12-2005 , 03:55 AM






Rene

This is code that I've use to do this. Hope it helps.

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
dim pkg
set pkg = DTSGlobalVariables.Parent

dim conOV
dim rs

set conOV = CreateObject("ADODB.Connection")
conOV.Open "File Name=" & DTSGlobalVariables("gvsOneViewLive_Udl").Value
set rs = CreateObject("ADODB.RecordSet")

rs.Open "tblSystemParameter", conOV
rs.movefirst

while not rs.EOF

If rs("ParamName") = "RPT_" +
DTSGlobalVariables("gvsMISEnvironment").Value & "_SAP_Unc" Then
DTSGlobalVariables("gvsSAPFilesUNC").Value = rs("ParamValue")
End If


rs.movenext
wend
rs.close
conOV.close

DTSGlobalVariables("gvsEmployees_UNCFileName").Val ue =
DTSGlobalVariables("gvsSAPFilesUNC").Value &
DTSGlobalVariables("gvsEmployeesFileName").Value

Main = DTSTaskExecResult_Success
End Function

"Rene H" wrote:

Quote:
Hello,
Instead of defining a dynamic property task in each DTS I rather would have
an ActiveX Script task changing the properties of a package.
1. Is this possible?
2. How is it done?
Thanks
Rene

Reply With Quote
  #3  
Old   
Rene H
 
Posts: n/a

Default RE: Change dynamic properties with ActiveX - 04-15-2005 , 07:20 PM



Hi Peter
Thanks for the code. I'll try it out. Do you know by any change if the
properties can be altered
by using the Set oAssignment = oCustomTask.Assignments.New?
Regards
Rene

"Peter" wrote:

Quote:
Rene

This is code that I've use to do this. Hope it helps.

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
dim pkg
set pkg = DTSGlobalVariables.Parent

dim conOV
dim rs

set conOV = CreateObject("ADODB.Connection")
conOV.Open "File Name=" & DTSGlobalVariables("gvsOneViewLive_Udl").Value
set rs = CreateObject("ADODB.RecordSet")

rs.Open "tblSystemParameter", conOV
rs.movefirst

while not rs.EOF

If rs("ParamName") = "RPT_" +
DTSGlobalVariables("gvsMISEnvironment").Value & "_SAP_Unc" Then
DTSGlobalVariables("gvsSAPFilesUNC").Value = rs("ParamValue")
End If


rs.movenext
wend
rs.close
conOV.close

DTSGlobalVariables("gvsEmployees_UNCFileName").Val ue =
DTSGlobalVariables("gvsSAPFilesUNC").Value &
DTSGlobalVariables("gvsEmployeesFileName").Value

Main = DTSTaskExecResult_Success
End Function

"Rene H" wrote:

Hello,
Instead of defining a dynamic property task in each DTS I rather would have
an ActiveX Script task changing the properties of a package.
1. Is this possible?
2. How is it done?
Thanks
Rene

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.