This is difficult but doable. I think that if you can just understand the
script below and adjust it to your needs it will work. You are going to
manipulate the dynamic properties task programmatically. This script is
reading an ini file that is called "test.ini" (this is specific to what you
are doing). The path is in the global variable "LogPath." The dynamic
property task assigns the value from test.ini to a global variable called
Message.
First you need to find out what DTS calls the assignment that reads the ini
file. Create and the following script. Watch for the DestinationPropertyID
that makes sense, and copy it verbatum (if you have only one assignment, you
can simplify this script). There may be other ways to get the information
you need. Be creative.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim file
dim tsk
dim assi
set tsk =
DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDynamicPropertiesTask_1").CustomTask
for each assi in tsk.Assignments
msgbox assi.DestinationPropertyID
next
Main = DTSTaskExecResult_Success
End Function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now we are ready for the real script. Where I have "'Global
Variables';'Message';'Properties';'Value'"
put the value you found for the assignment you want to make
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim file
dim tsk
dim assi
file = DTSGlobalVariables("LogPath").Value & "\test.ini"
set tsk =
DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDynamicPropertiesTask_1").CustomTask
for each assi in tsk.Assignments
if assi.DestinationPropertyID = "'Global
Variables';'Message';'Properties';'Value'" then
assi.SourceIniFileFileName = file
end if
next
Main = DTSTaskExecResult_Success
End Function
--
Russel Loski, MCSD.Net
[quoted text, click to view] "Webtechie" wrote:
> Hello,
>
> I've created a DTS package that works off a ini file on a server. The
> server is a development server. Now I need to move it to QA. I save the
> file for the QA folks. I've got an ActiveX script that takes the values out
> of the ini file and creates the global variables to run the rest of the
> package.
>
> The problem: The dynamic properties task is still looking at the ini file
> on the DEV server.
>
> Is there a way to program the dynamic properties to look at the ini file on
> the server where the package is being run?
>
> I could always change the values in the dynamic properties task, save it
> under a different name as myPackage_QA.dts and deploy this package. However,
> I would rather not have multiple copies of the package.
>
> Any thoughts or ideas on a better way?
>
> Thanks,
>