dbTalk Databases Forums  

DTS Package error out when called from VB.NET

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Package error out when called from VB.NET in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Wildes
 
Posts: n/a

Default DTS Package error out when called from VB.NET - 06-16-2004 , 09:13 AM






Hello All

I have a DTS package that works fine when I run it from Enterprise
Manager, but when I call it from VB.NET all of the components fail. The
number of the error message is 0 . I have included code that I use to
run the DTS package. How do I troubleshoot this?

Thanks for any help
john

Quote:
CODE
Imports DTS

Module DataFunctions

Public Function refreshStatementData(ByVal progressbar As
System.Windows.Forms.ProgressBar, ByVal label As System.Windows.Forms.Label)
Dim pkg As New DTS.Package
Dim steps As String
Dim bStatus As Boolean
Dim errSource As String
Dim errDescription As String
Dim i As Integer
Dim oStep As [Step]
Dim sMessage As String


'load DTS package from server
pkg.LoadFromSQLServer("USGLE98APPFX100", "stmt", "generator", ,
, , , "Refresh TAM Data", )
pkg.Execute()

For Each oStep In pkg.Steps
sMessage = oStep.Description
If oStep.ExecutionResult =
DTSStepExecResult.DTSStepExecResult_Failure Then
sMessage = sMessage & " failed."
bStatus = False
label.Text = sMessage
oStep.GetExecutionErrorInfo(i)
MsgBox("Refresh Statement Data step " & sMessage & "
with error code " & i, MsgBoxStyle.Information, "Refresh Statement
Generator Data")
Else
sMessage = sMessage & " succeeded."
label.Text = sMessage
progressbar.PerformStep()
bStatus = True
MsgBox("Refresh Statment Data step " & sMessage,
MsgBoxStyle.Information, "Refresh Statement Generator Data")
End If
Next

End Function 'refreshStatementData

End Module


Reply With Quote
  #2  
Old   
John Wildes
 
Posts: n/a

Default Re: DTS Package error out when called from VB.NET - 06-16-2004 , 02:07 PM






In addition I've run this via DTSRUN and here is the output I get

In this output below the database 'TAM' is a System DSN 'TAM' using
Visual FoxPro drivers pointing to a path that contains DBF files
\\usglentappdb100\appld_data\tam is the UNC . I am assuming that
because I am not running this from the console of the SQL server that it
is attempting to login to the USGLENTAPPDB100 sever but that part is
failing. What NT username is the process using to RUN the DTS package
where could I specify this so that the SQL server can access this DBF
file share on the other server.

Can anyone shed some light on this ?

Thanks for any help
john


Quote:
DTSRUN OUTPUT
C:\Documents and Settings\jwildes>dtsrun /S USGLE98APPFX100 /U stmt /P
generator /N "REFRESH TAM DAT
A"
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSExecuteSQLTask_2
DTSRun OnError: DTSStep_DTSExecuteSQLTask_2, Error = -2147467259 (80004005)
Error string: Cannot open database requested in login 'TAM'. Login
fails.
Error source: Microsoft OLE DB Provider for SQL Server
Help file:
Help context: 0

Error Detail Records:

Error: -2147467259 (80004005); Provider Error: 4060 (FDC)
Error string: Cannot open database requested in login 'TAM'. Login
fails.
Error source: Microsoft OLE DB Provider for SQL Server
Help file:
Help context: 0

DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_2
DTSRun: Package execution complete.


Quote:

John Wildes wrote:
Quote:
Hello All

I have a DTS package that works fine when I run it from Enterprise
Manager, but when I call it from VB.NET all of the components fail. The
number of the error message is 0 . I have included code that I use to
run the DTS package. How do I troubleshoot this?

Thanks for any help
john

CODE
Imports DTS

Module DataFunctions

Public Function refreshStatementData(ByVal progressbar As
System.Windows.Forms.ProgressBar, ByVal label As
System.Windows.Forms.Label)
Dim pkg As New DTS.Package
Dim steps As String
Dim bStatus As Boolean
Dim errSource As String
Dim errDescription As String
Dim i As Integer
Dim oStep As [Step]
Dim sMessage As String


'load DTS package from server
pkg.LoadFromSQLServer("USGLE98APPFX100", "stmt", "generator", ,
, , , "Refresh TAM Data", )
pkg.Execute()

For Each oStep In pkg.Steps
sMessage = oStep.Description
If oStep.ExecutionResult =
DTSStepExecResult.DTSStepExecResult_Failure Then
sMessage = sMessage & " failed."
bStatus = False
label.Text = sMessage
oStep.GetExecutionErrorInfo(i)
MsgBox("Refresh Statement Data step " & sMessage & "
with error code " & i, MsgBoxStyle.Information, "Refresh Statement
Generator Data")
Else
sMessage = sMessage & " succeeded."
label.Text = sMessage
progressbar.PerformStep()
bStatus = True
MsgBox("Refresh Statment Data step " & sMessage,
MsgBoxStyle.Information, "Refresh Statement Generator Data")
End If
Next

End Function 'refreshStatementData

End Module

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.