I went on testing and both my assumption are wrong...
Quote:
I think the issue can be due to two different reasons:
1) The variable is not passed correctly to the script, but also DTSRUN
fails in the same way using /A....parameter |
Using the correct sintax in DTSRUN command line or using DTSRUNUI works
fine, the parameter is passed correctly and the DTS packages does what it
should...
Quote:
2) Security access to the file system by ASPNET user, but if I force it
using A:\, I can see the led light on |
If I give a floppy or a fixed drive in the path it always works when the
fiel is there...
Quote:
Looking forward for an idea or fix. Regards, |
The only idea I can have is that the parameter is not passed corretly to the
activex script in the dts from the code. I put it the interesting part if
someone can see what I can't:
package = new PackageClass();
UCOMIConnectionPointContainer CnnctPtCont =
(UCOMIConnectionPointContainer) package;
UCOMIConnectionPoint CnnctPt;
PackageEventsSink PES = new PackageEventsSink ();
Guid guid = new Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5"); // UUID
of PackageEvents Interface
CnnctPtCont.FindConnectionPoint(ref guid, out CnnctPt);
int iCookie;
CnnctPt.Advise(PES, out iCookie);
object pVarPersistStgOfHost = null;
//Retrieve global settings from the Configuration File
string serverName = ConfigurationSettings.AppSettings["serverName"];
string userName = ConfigurationSettings.AppSettings["userName"];
string password = ConfigurationSettings.AppSettings["password"];
string packageName = ConfigurationSettings.AppSettings["packageName"];
package.LoadFromSQLServer(serverName, userName, password,
DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, null, null, null,
packageName, ref pVarPersistStgOfHost);
//Loop through all the Global variables and remove the variables that
are of type string
foreach(GlobalVariable global in package.GlobalVariables)
{
if (global.Name == "gFilePath")
{
package.GlobalVariables.Remove(global.Name);
}
}
//Re-add all the global variables that are of type string
package.GlobalVariables.Add("gFilePath","A:\\SR050 118.CSV");
//Execute the Package
package.Execute();
package.UnInitialize();
package = null;
CnnctPt.Unadvise(iCookie);
----------------------------------------------------------------------------------------------------------
The analogue command in DTSRUN instead works smothly:
DTSRun /S"(local)" /U"xxxxxxxxx" /P"xxxxxxxxxxx" /N"Aggiorna3"
/A"gFilePath":"8"="A:\SR050118.CSV"
-----------------------------------------------------------------------------------------------------------