Wrox Programmer Forums
|
BOOK: Professional Microsoft SQL Server 2008 Integration Services ISBN: 978-0-470-24795-2
This is the forum to discuss the Wrox book Professional Microsoft SQL Server 2008 Integration Services by Brian Knight, Erik Veerman, Grant Dickinson, Douglas Hinson, Darren Herbold; ISBN: 9780470247952
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Microsoft SQL Server 2008 Integration Services ISBN: 978-0-470-24795-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2012, 03:10 AM
Registered User
 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Post Zip text file through C# or VB.Net

Hi,
i have activeX script for file zipping but winzip hangs during my schedule job. i am very new to SSIS and need some help to transform this activeX script into Script task. Any help will be much appreciated.

my code is as follows:
Quote:
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

dim oshell, strdate, strzip_pwd
set oshell = createobject("WScript.shell")

strzip_pwd = Get_Zip_Access()

strdate = mid(now,7,4) & mid(now,4,2) & mid(now,1,2)
DTSGlobalVariables("@ZipFileName") = "Service_Desk_Corporate_Extract_" & strdate & ".zip"

oshell.run "winzip32 -a -P -r -s" & strzip_pwd & " \\w2k4432\Non_NAS_Migration\Data_Management\Data_F eeds\Corporate\Extracts\" & DTSGlobalVariables("@ZipFileName") & " \\w2k4432\Non_NAS_Migration\Data_Management\Data_F eeds\Corporate\Extracts\" & DTSGlobalVariables("@ExtractFileName"),SW_HIDE,Tru e


set oshell = nothing
Main = DTSTaskExecResult_Success

End Function

Function Get_Zip_Access()

dim myConn
dim myRecordset
dim mySQLCmdText

set myConn = CreateObject("ADODB.Connection")
set myRecordset = CreateObject("ADODB.Recordset")

myConn.Open "Provider=sqloledb;" & _
"Data Source=w2k4432;" & _
"Database=Zip_Access;" & _
"Integrated Security=SSPI"


mySQLCmdText = "Select * From tblZip_Access where ([From] <= GETDATE()) AND ([To] >= GETDATE())"

myRecordset.Open mySQLCmdText, myConn

if myRecordset.eof = true Then
Get_Zip_Access = "No Password"
else
Get_Zip_Access = myRecordset("password") & ""
end if

End Function





Similar Threads
Thread Thread Starter Forum Replies Last Post
Vb.Net 2003 : How to Open and Read an XML File to TEXT File. Lennie VS.NET 2002/2003 0 February 12th, 2010 05:18 PM
Read Text file and convert to Binary file VB.net sjlsysprg1 Pro VB.NET 2002/2003 4 June 29th, 2007 06:53 AM
how can i zip a file in vb 6.0?? rocksbhavesh Pro VB 6 5 April 23rd, 2007 01:11 PM
Save PDF file as text file in VB.Net kvenkatu Classic ASP Basics 0 April 7th, 2006 01:09 PM
save a PDF file as text file through VB. NET kvenkatu VB.NET 0 April 6th, 2006 12:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.