Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Posts
    9

    Unanswered: ActiveX ActivePerl DTS Task

    I need help with executing an ActiveX Perl DTS Task.

    I have ActivePerl installed and I do not get a task error when I run it. The script works perfectly when I run it from a command prompt. The problem is that the task will not extract the files from the tar file.

    sub Main()
    {
    #using modules
    use Archive::Tar;
    use Compress::Zlib;

    #create a new tar archive object
    my $tar = Archive::Tar->new;

    #set the name of the compressed files
    $main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp .tar";

    #read the main tar file and extract files
    $tar->read($main_tar,1);
    $tar->extract();

    return 0; # DTSTaskExecResult_Success;
    }

    Any clue?

  2. #2
    Join Date
    Dec 2003
    Posts
    9

    Re: ActiveX ActivePerl DTS Task

    I think I know why it appears that it wasn't working. It worked but not like I expected. It extracted the files into the default sql server directory.

    So My next question is how do specify the directory to extract to?

    Originally posted by jcochran2003
    I need help with executing an ActiveX Perl DTS Task.

    I have ActivePerl installed and I do not get a task error when I run it. The script works perfectly when I run it from a command prompt. The problem is that the task will not extract the files from the tar file.

    sub Main()
    {
    #using modules
    use Archive::Tar;
    use Compress::Zlib;

    #create a new tar archive object
    my $tar = Archive::Tar->new;

    #set the name of the compressed files
    $main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp .tar";

    #read the main tar file and extract files
    $tar->read($main_tar,1);
    $tar->extract();

    return 0; # DTSTaskExecResult_Success;
    }

    Any clue?

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    This is really a perl question but I would try setting the directory by using the SetCwd(directory) command.

  4. #4
    Join Date
    Dec 2003
    Posts
    9
    Thanks I will try that.

  5. #5
    Join Date
    Dec 2003
    Posts
    9
    I keep getting a "Function not found" error. Can anybody give me a peice of sample code using Win32:etCwd()?

  6. #6
    Join Date
    Dec 2003
    Posts
    9
    Here is the updated perl script.

    #using modules
    use Archive::Tar;
    use Compress::Zlib;
    use Win32::File;

    sub Main()
    {
    #create a new tar archive object
    my $tar = Archive::Tar->new;

    #set the name of the compressed files
    $main_tar = "C:\Inetpub\wwwroot\legacyrealestate\db\DW168E.tmp .tar";
    $res_tar = "ListingsRESIDENTIAL-Residential.txt.gz";

    # set the directory
    $dir = "C:\Inetpub\wwwroot\legacyrealestate\db\";
    Win32:etCwd($dir);

    #read the main tar file and extract files
    $tar->read($main_tar,1);
    $tar->extract();

    return 0; # DTSTaskExecResult_Success;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •