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?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?|||This is really a perl question but I would try setting the directory by using the SetCwd(directory) command.|||Thanks I will try that.|||I keep getting a "Function not found" error. Can anybody give me a peice of sample code using Win32::SetCwd()?|||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::SetCwd($dir);
#read the main tar file and extract files
$tar->read($main_tar,1);
$tar->extract();
return 0; # DTSTaskExecResult_Success;
}
Showing posts with label executing. Show all posts
Showing posts with label executing. Show all posts
Sunday, March 25, 2012
Thursday, February 16, 2012
Accessing SQL Server using C++
What is the easiest way to start executing SQL statements onto a SQL Server 2000 using C++ ???
Are there any libraries or something I could use ?Microsoft provides a whole range of ADO libraries that could help you get started.|||I'd start here (http://search.microsoft.com/search/results.aspx?qu=ado+vc&View=msdn&st=b&c=0&s=1&swc=0).
-PatP
Are there any libraries or something I could use ?Microsoft provides a whole range of ADO libraries that could help you get started.|||I'd start here (http://search.microsoft.com/search/results.aspx?qu=ado+vc&View=msdn&st=b&c=0&s=1&swc=0).
-PatP
Subscribe to:
Posts (Atom)