![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I'm getting the following error when executing a DTS package from VB.Net. The DTS packages runs fine from the designer and used to run fine as well from VB.net "Global variable 'ExportedRowCount' already exists in the collection" Here's my vb.net code. The error occurs right after the .LoadFromSqlServer SELECT @@VERSION = "Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows NT 5.2 (Build 3790: " Note: I tried specifying the GUID for the package and vesion also, but this didn't help. Please help as I'm pulling out my hair. Thanks, .jelling Dim dbServer As String = AppSettings("dbServer") Dim uid As String = AppSettings("uid") Dim pwd As String = AppSettings("pwd") Dim packageName As String = AppSettings("PE_DTSPackageName") Dim checkRecordsError As String Dim exportedRowCount As Integer Dim exportedFileName As String = m_sWorkingDir & "\" & GetTodaysFileName() Dim i As Integer Dim ExStatus As String Dim objDTS As New DTS.Package() Try With objDTS .LoadFromSQLServer(dbServer, uid, pwd, DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , packageName) .GlobalVariables.Remove("StartDate") .GlobalVariables.AddGlobalVariable("StartDate", m_dStartDate) .GlobalVariables.Remove("EndDate") .GlobalVariables.AddGlobalVariable("EndDate", m_dEndDate) .GlobalVariables.Remove("SubStatusCodesToExport") .GlobalVariables.AddGlobalVariable("SubStatusCodes ToExport", m_sStatusFilter) .GlobalVariables.Remove("Company") .GlobalVariables.AddGlobalVariable("Company", m_sVendor) .GlobalVariables.Remove("OutboundFile") .GlobalVariables.AddGlobalVariable("OutboundFile", m_sFtpDestDir & "\archive\" & m_sTodaysFileName) '# i tried these next two lines with no luck after the problem started '.GlobalVariables.Remove("ExportedRowCount") '.GlobalVariables.AddGlobalVariable("ExportedRowCo unt", 0) .Execute() End With |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |