Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS ActiveX Script FileSystemObject Problem

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
Hello group,

I have created a DTS Package that will import files.

The first task in the packages is an ActiveX Script task to determine if files exist in a folder, then it will run the rest of the package.

It runs fine from the designer on my machine, but when it is scheduled, the package runs, but none of the files get imported. Its as if the ActiveX task cannot see the files in the folder to know to import them.

Both the SQL Server, and the SQL Server Agent are running under the Network/Administrator account. And this account has FULL Access to all files and folders in the network.

The Files reside on a Fileshare on one of our servers, which the Network/Administrator has full control.

Any ideas?
Thanks in Advance
[cannon]

George Oakes
Check out this awsome .Net Resource!
 
I fixed my own problem.

In the ActiveX Script I was looking for zip files using this method

Code:
For each oFile in oFolder.Files
 if ofile.type = "ZIP file" then 
   DTSGlobalVariables("gZipFileName").Value = ofile.path
 End if
Next

The reason it worked on my machine is because my computer knows that a .zip extension is a "ZIP file" Where the SQL server does not know that the .zip extension is a "ZIP file"
So what I did to fix the problem was to look for the text .ZIP in the file.shortname (shortname is the 8x3 ms-dos filename)
The following code works on the server now.

Code:
For Each oFile in oFolder.Files
 if InStr(1 ,Ucase(oFile.shortname) , ".ZIP" ) > 0  then 
   DTSGlobalVariables("gZipFileName").Value = ofile.path
 End if
Next

Thanks for taking a look
[cannon]

George Oakes
Check out this awsome .Net Resource!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top