March 15, 2004 at 5:48 am
can i export file from dts in zip/ace/rar format?
March 15, 2004 at 7:12 am
I don't think you can directly export in a compressed format (hopefully someone will correct me if I am wrong) - but you can export the file, then use a cmdexec step to zip the file and delete the original. You will still need to have sufficient disk space for the full export though, and zip tool that can be accessed from the command line (Winzip works). Hope this helps.
March 15, 2004 at 8:11 am
How???
March 15, 2004 at 8:24 am
set @sourceFile = '\\networkname\filename.txt'
set @archiveFile = '\\networkname\filename.zip'
set @rar = '"C:\Program Files\WinRAR\rar.exe" a -df ' + @archiveFile + ' ' + @sourceFile
set @sqlstate =
'EXEC master.dbo.xp_cmdshell ''' + @rar + ''''
exec (@sqlstate)
Just one way to do it, using winrar as opposed to winzip. winzip will work much the same way, except you have to install the command line version of winzip. The help files of either winrar or winzip will give you the command line flags you need.
March 16, 2004 at 2:58 am
I recently tried to do something similar. I downloaded WZZIP the command line addon from http://www.winzip.com
The documentation for WZZIP is included in a help file type wzzip /? at the DOS Command prompt.
For example:
CREATE PROCEDURE procZipFilePassword
@IncomingFile varchar(255) = null,
@Zipfile varchar(255) = null,
@Password varchar(10) = null
AS
declare @cmdshell varchar(255)
declare @Result int
set @cmdshell = 'C:\Progra~1\WinZip\WZZIP.EXE -a -s' + @Password + ' '+ @zipfile + ' ' + @IncomingFile
exec @Result = master..xp_cmdshell @cmdshell, NO_OUTPUT
RETURN @Result
GO
To call above:
Declare @ReturnValue int
EXEC @ReturnValue = procZipFilePassword 'C:\Test\MyExcelFile.XLS','C:\Test\MyZipFile.zip', 'MyPassword'
SELECT @ReturnValue as ReturnValue
March 16, 2004 at 3:20 am
Hi Thanks its working
April 13, 2004 at 7:09 am
What are you doing about licencing?
I would love to use wzzip, but only if it can be built into our application. We do not want to administer winzip licences, when we sell a copy of our program.
As far as I can figure out, you need to purchase a copy if you do not want to press "enter".
Are there other alternatives?
One would be to buy a zip library and then build a Delphi or VBB or ... program with it.
But it would require us to install dll's and do other registration.
How to get a program that does not require site licensing?
Regards
Henrik Staun Poulsen
April 13, 2004 at 9:03 am
Take a look for freeware and shareware zip tools, especially the opensource dos ones.
I use pkzip25, it works great, is fast.
April 14, 2004 at 1:29 am
Thanks, but pkzip25 is not free? Is it possible to buy distribution rights?
I've looked at CNET and found 11 free tools. but couldn't see if they have a command line interface.
April 14, 2004 at 2:40 am
Hi,
I'm using "IZARC" (http://www.izsoft.dir.bg). The command line offers a limeted set of features (just Zip a file without encryption or password).
The only problem is that it opens a window if the zip-file allready exists. So make sure, that the target file doesn`t exist.
Or use a free programming library like SharZipLib (for .NET) an build your own little Zip-application if you need encryption.
Regards,
WiWo
April 14, 2004 at 5:04 am
Freeware Zip Util, dos based, so there is no install associated.... http://www.info-zip.org/pub/infozip/
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply