Executing DTS from VB on remote server -
03-17-2006
, 02:05 PM
Hi,
I'd like to execute a DTS on a remote SQL Server from a VB.net
application.
I set a few GlobalVariables (by removing them, changing the value and
adding them back to the DTS) and call the DTS on my remote server.
First step is an ActiveX script. It crash immediatly 'cause it says it
cannot find the file I've specified in the GlobalVariables. That file
is locate in another server. I've already created a mapdrive to the
right folder, from my remote SQL Server, to the other server.
here is some code:
szFilename = Trim( DTSGlobalVariables("Path File").Value &
DTSGlobalVariables("Data File").Value)
msgbox szFilename
Set tsData = GetSrcFile( "K:\Mar 2006\Command_17.txt" )
the msgbox display the right value but if I write:
Set tsData = GetSrcFile( szFilename )
it crash (Object required: GetSrcFile(...)
so it's why I tried to hardcode a value. That way, the GetSrcFile
works, but ONLY if my local computer have a mapdrive to K:. But the
mapdrive shouldn't be on my computer, only on the server! Also, I have
a few other files my DTS uses. These files are declared also in the
GlobalVariables. But when the DTS tries to open these files, I get an
error, because it tries to open them on MY computer. Of course they are
not on my harddrive, they are located on the server.
The DTS run fine if I execute it directly on Enterprise Manager.
does anyone can help me solve this please?
thanks a lot |