If connection properties and global variables are set from an INI
file, how can a DTS package be made truly portable?
If the INI file pathname is hard-coded in the package, it must be
edited when you copy the package to a new environment; otherwise your
packages in multiple environments will all reference the same INI
file. If there are dozens of properties that need to be set
dynamically (for example, connections that reference different text
files), changing the pathname of the INI file for each one can be a
real bear.
I was hoping to be able to set the pathname of the INI file from the
command line as a global variable. Then the package could be pointed
dynamically to one of several INI files. However, the pathname for
the INI file cannot be set dynamically from a global variable, as far
as I can tell.
One alternative would be to set connection properties and global
variables from the command line. Again, if there are dozens of
connections, the command line will be quite long!
Does anyone have any suggestions? What is the limit to command-line
length in WIN 2000?
Thanks! 2 7281
Comments inline.
Simon
"Theodore Feldman" <th************ **@fmglobal.com > wrote in message
news:26******** *************** ***@posting.goo gle.com... If connection properties and global variables are set from an INI file, how can a DTS package be made truly portable?
You don't have to use an INI file - you can use other sources, including a
database query, which is often the most flexible and powerful.
If the INI file pathname is hard-coded in the package, it must be edited when you copy the package to a new environment; otherwise your packages in multiple environments will all reference the same INI file. If there are dozens of properties that need to be set dynamically (for example, connections that reference different text files), changing the pathname of the INI file for each one can be a real bear.
You could store these in a database table, along with some key values such
as site code, package name etc. to identify which set of values are to be
used in which "environmen ts".
I was hoping to be able to set the pathname of the INI file from the command line as a global variable. Then the package could be pointed dynamically to one of several INI files. However, the pathname for the INI file cannot be set dynamically from a global variable, as far as I can tell.
You can just pass the server name and database name of the "configurat ion
database" from the command line, then retrieve the rest of the values from
the parameters table, based on whatever criteria are most useful in your
situation.
One alternative would be to set connection properties and global variables from the command line. Again, if there are dozens of connections, the command line will be quite long!
Probably better to pass the minimum number of values on the command line and
retrieve the rest from some other location. Using database tables makes
centralized management and logging much easier.
Does anyone have any suggestions? What is the limit to command-line length in WIN 2000?
No idea, but as you mentioned, the command line is quite limiting. If you
really had to do this, it would probably be easier to call the DTS package
and set the variables from VB, using some sort of config file (back to INI
files again), rather than cram everything onto the command line.
If connection properties and global variables are set from an INI file, how can a DTS package be made truly portable?
If the INI file pathname is hard-coded in the package, it must be
edited when you copy the package to a new environment; otherwise your
packages in multiple environments will all reference the same INI
file. If there are dozens of properties that need to be set
dynamically (for example, connections that reference different text
files), changing the pathname of the INI file for each one can be a
real bear.
I was hoping to be able to set the pathname of the INI file from the
command line as a global variable.
Totally agree with the sentiment. I had a similar problem.
What I have done is to create a Dynamic Properties task which sets all of the variables that I want to populate from an ini file. In the Dyn Props task I specified a valid 'hard coded' ini file name, since as you say it cannot be entered as a parameter.
BUT, at runtime it becomes dynamic! This is achieved by creating an activex script task which is executed prior to the Dynamic properties task and whose job it is to set the actual ini file values in the Dyn Props task at run time for any assignments which are INI file based. This can then be set to a global var, environment var or whatever you want.
The text of my activex script is below
Hope it helps! -
-
'**********************************************************************
-
' Visual Basic ActiveX Script
-
'************************************************************************
-
-
-
-
Function Main()
-
-
'----
-
' Get the MY_INI_FILE environment variable
-
'----
-
-
Dim shell, env
-
Set shell = CreateObject("WScript.Shell")
-
Set env = shell.Environment("process")
-
-
iniFileName=env("MY_INI_FILE")
-
'---
-
' nb. we could equally have set iniFileName from a variety of places, such as
-
' a global var for example, which could be passed in on the command line to dtsrun:
-
' e.g. replace the above lines with:
-
'iniFileName= DTSGlobalVariables("MY_INI_FILE")
-
-
-
'----
-
' Get the package object so that we can get a handle to our dynamic properties task
-
'----
-
-
Set oPkg = DTSGlobalVariables.Parent
-
Set oDynProps = oPkg.Tasks("DTSTask_DTSDynamicPropertiesTask_2").CustomTask
-
-
'----
-
' iterate through the dynmic property assignments for the selected dynprops task
-
'----
-
for each oAssign in oDynProps.assignments
-
-
if oAssign.sourceType = DTSDynamicPropertiesSourceType_IniFile then
-
-
'----
-
'whenever the source type is an ini file, change the file name
-
'----
-
oAssign.SourceIniFileFileName = iniFileName
-
end if
-
next
-
-
'----
-
'Return Success
-
'----
-
-
Main = DTSTaskExecResult_Success
-
-
End Function
-
-
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tim Tyler |
last post by:
I just ported one of the apps I wrote using PHP 5 under Windows to
PHP 4 under unix.
I knew I wanted to deploy in this environment - and wrote my code in
anticipation of running in the other environment.
A brief summary follows:
Portability was not too bad. However there were several problems I did
not anticipate.
|
by: Qiangning Hong |
last post by:
I am writing a setup.py for my package. I have a pre-compiled
myextmod.pyd file in my package and I want the distutils to
automatically copy it to
C:\Python23\Lib\site-packages\mypackage\myextmod.pyd.
I try to add the following parameter to setup():
data_file = )],
but it installs the pyd file to C:\Python23\mypackage\myextmod.pyd,
|
by: fabio de francesco |
last post by:
Hi,
I'm not a professional programmer, but I've been writing C/C++ and Ada
programs for a few years on GNU/Linux without ever concerning on
standards and portability to other OSs.
I've always noted that when I write code I must use lots of platform
specific system calls (POSIX and X/OPEN). Often I found myself using
threads and concurrent processes with some sort of IPC. Some time I
need some socket API. When I just want to open a...
|
by: asm |
last post by:
Hi All,
Like typdef, does C have further support for portability?
Thanks,
ASM
|
by: roman ziak |
last post by:
I just read couple articles on this group and it keeps amazing me how
the portability is used as strong argument for language cleanliness.
In my opinion, porting the program (so you just take the source code and
recompile) is a myth started 20-30 years ago when world consisted of
UNIX systems. Well, world does not consist of UNIX systems anymore, but
there are 100s of different systems running in cell-phones, DVD players,
game consoles...
| |
by: David Pratt |
last post by:
Hi. I have code that currently depends on a particular package of a
framework. I have decided I want to create my own package because I have
made many changes and it is getting too difficult to maintain each time
I retrieve an updated version of the framework from svn.
The problem is, that there are all sorts of imports to the dependent
package throughout my code and I just want to replace this module with
something that will provide a...
|
by: jacob navia |
last post by:
In this group there is a bunch of people that call themselves 'regulars'
that insist in something called "portability".
Portability for them means the least common denominator.
Write your code so that it will compile in all old and broken
compilers, preferably in such a fashion that it can be moved with no
effort from the embedded system in the coffe machine to the 64 bit
processor in your desktop.
|
by: Eigenvector |
last post by:
My question is more generic, but it involves what I consider ANSI standard C
and portability.
I happen to be a system admin for multiple platforms and as such a lot of
the applications that my users request are a part of the OpenSource
community. Many if not most of those applications strongly require the
presence of the GNU compiling suite to work properly. My assumption is that
this is due to the author/s creating the applications...
|
by: jacob navia |
last post by:
One of the holy cows here is this "portability" stuff.
In practice, portability means:
1) Use the least common denominator of all the supported
systems.
2) Between usability / good user experience and portability
always choose portability since this minimizes programming
effort
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |