Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 22nd, 2012, 04:10 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 07:53 AM
how can i zip a file in vb 6.0?? rocksbhavesh Pro VB 6 5 April 23rd, 2007 02:11 PM
Save PDF file as text file in VB.Net kvenkatu Classic ASP Basics 0 April 7th, 2006 02:09 PM
save a PDF file as text file through VB. NET kvenkatu VB.NET 0 April 6th, 2006 01:15 PM



All times are GMT -4. The time now is 12:45 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.