Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 8th, 2008, 04:20 AM
Registered User
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why Created 2 Excel file?

Hi,

I create DTS 2000 package but it come out with 2 Excel file.

DTS Flow Design : http://img363.imageshack.us/my.php?i...5891081fx7.jpg
1. ActiveX SCript to create Excel with timestamp
2. Create Table 'Redemption' in Excel
3. Connection from Database
4. Output the Excel

ActiveX Script
Function Main()

          Dim appExcel
          Dim newBook
          Dim oSheet

          dim oPackage
          dim oConn

          Set appExcel = CreateObject("Excel.Application")
          Set newBook = appExcel.Workbooks.Add
          Set oSheet = newBook.Worksheets(1)

          'Specify the name of the new Excel file to be created

          DTSGlobalVariables("fileName").Value = "C:\Redemption_" & Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) &".xls"

          With newBook
               .SaveAs DTSGlobalVariables("fileName").Value
               .save
          End With

          appExcel.quit

          'dynamically specify the destination Excel file

          set oPackage = DTSGlobalVariables.parent
    set oConn = oPackage.connections(2)
          oConn.datasource = DTSGlobalVariables("fileName").Value

         set oPackage = nothing
          set oConn = nothing

          Main = DTSTaskExecResult_Success

End Function






Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Excel to display created forms Borhani Excel VBA 2 January 19th, 2008 07:42 AM
Viewing asp created file chayz Classic ASP Basics 1 January 14th, 2005 08:47 AM
Using the FileSystemWatcher to copy Created file EnricoSaunders VB.NET 1 October 28th, 2004 11:39 PM
Excel Workbook created from Access VBA clueless_may Access VBA 0 June 8th, 2004 09:42 AM
Can't get image file created on localhost Bob Bedell Dreamweaver (all versions) 8 October 6th, 2003 09:43 PM





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