Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ciaran
Starting Member
40 Posts |
Posted - 2005-08-11 : 07:52:09
|
Hi, I have 12 text file (source) objects on my dts package. I need to iterate over these and set their paths dynamically in an active x component. How do i do this.I have stored the paths in an ini file which i initially load into global variables. Here is how i do it for sql connection objectsFunction SetupDBConnection()set pkg = DTSGlobalVariables.parentdbPortalDataSource= DTSGlobalVariables("PORTALSERVER").valuedbPortalInitialCatalog = DTSGlobalVariables("PORTALDB").valuedbPortalUserId = DTSGlobalVariables("PORTALUSERNAME").valuedbPortalPassword = DTSGlobalVariables("PORTALPASSWORD").valuefor each packageConn in pkg.connections if packageConn.ProviderID = "SQLOLEDB" then if packageConn.Name = "Portal" then packageConn.datasource = dbPortalDataSource packageConn.Catalog = dbPortalInitialCatalog packageConn.UserId = dbPortalUserId packageConn.Password = dbPortalPassword end ifif packageConn.Name = "RBConnection" then packageConn.datasource = DTSGlobalVariables("CLIENTSERVER").value packageConn.Catalog = DTSGlobalVariables("CLIENTDB").valuepackageConn.UserId = DTSGlobalVariables("CLIENTUSERNAME").valuepackageConn.Password = DTSGlobalVariables("CLIENTPASSWORD").valueend ifend ifnextEnd FunctionHowever my attempt at the text file source is seriously dierespecting me. basically what will i substitute this line with if packageConn.ProviderID = "SQLOLEDB" then |
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2005-08-15 : 07:58:05
|
HiReplace "SQLOLEDB" with "DTSFlatFile". Just out of interest, why do you need to do this dynamically?Mark |
 |
|
ciaran
Starting Member
40 Posts |
Posted - 2005-08-15 : 12:51:28
|
i need to keep the dts package independent of where its currently living. ie i need to run the package on different servers. i will read the first part of the path from an ini filethanks for the reply by he wayquote: Originally posted by mwjdavidson HiReplace "SQLOLEDB" with "DTSFlatFile". Just out of interest, why do you need to do this dynamically?Mark
|
 |
|
|
|
|