S
scott
I'm trying to run a SQL DTS package that resides on my server. I'm using the
below code from a command button within my access file. This used to work a
few years back, but no loner will.
I'm using Office 2003 and have SQL 2005 developer edition on my pc and have
SQL 2000 (runs the SQL DTS package) on my Windows 2003 server. Also note, I
am using the proper MS DTSPackage Library within my References. My server
also has SQL 2000 Service Pack 4 installed.
Does anyone know if maybe Windows XP Service Pack 2 maybe causing it to
fail? Any other ideas?
CODE *************************
Dim oPKG As DTS.Package, oStep As DTS.step
Set oPKG = New DTS.Package
Dim sServer As String, sUsername As String, sPassword As String
Dim sPackageName As String, sMessage As String
Dim lErr As Long, sSource As String, sDesc As String
' Set Parameter Values
sServer = "myServer"
sUsername = "sa"
sPassword = "password"
sPackageName = "update_myDTS_job"
' Use mixed mode authentication
oPKG.LoadFromSQLServer sServer, sUsername, sPassword, _
DTSSQLStgFlag_Default, , , , sPackageName
' Set Exec on Main Thread
For Each oStep In oPKG.Steps
oStep.ExecuteInMainThread = True
Next
oPKG.Execute
' Get Status and Error Message
For Each oStep In oPKG.Steps
If oStep.ExecutionResult = DTSStepExecResult_Failure Then
oStep.GetExecutionErrorInfo lErr, sSource, sDesc
sMessage = sMessage & "Step """ & oStep.name & _
""" Failed" & vbCrLf & _
vbTab & "Error: " & lErr & vbCrLf & _
vbTab & "Source: " & sSource & vbCrLf & _
vbTab & "Description: " & sDesc & vbCrLf & vbCrLf
Else
sMessage = sMessage & "Step """ & oStep.name & _
""" Succeeded" & vbCrLf & vbCrLf
End If
Next
oPKG.UnInitialize
Set oStep = Nothing
Set oPKG = Nothing
MsgBox sMessage
below code from a command button within my access file. This used to work a
few years back, but no loner will.
I'm using Office 2003 and have SQL 2005 developer edition on my pc and have
SQL 2000 (runs the SQL DTS package) on my Windows 2003 server. Also note, I
am using the proper MS DTSPackage Library within my References. My server
also has SQL 2000 Service Pack 4 installed.
Does anyone know if maybe Windows XP Service Pack 2 maybe causing it to
fail? Any other ideas?
CODE *************************
Dim oPKG As DTS.Package, oStep As DTS.step
Set oPKG = New DTS.Package
Dim sServer As String, sUsername As String, sPassword As String
Dim sPackageName As String, sMessage As String
Dim lErr As Long, sSource As String, sDesc As String
' Set Parameter Values
sServer = "myServer"
sUsername = "sa"
sPassword = "password"
sPackageName = "update_myDTS_job"
' Use mixed mode authentication
oPKG.LoadFromSQLServer sServer, sUsername, sPassword, _
DTSSQLStgFlag_Default, , , , sPackageName
' Set Exec on Main Thread
For Each oStep In oPKG.Steps
oStep.ExecuteInMainThread = True
Next
oPKG.Execute
' Get Status and Error Message
For Each oStep In oPKG.Steps
If oStep.ExecutionResult = DTSStepExecResult_Failure Then
oStep.GetExecutionErrorInfo lErr, sSource, sDesc
sMessage = sMessage & "Step """ & oStep.name & _
""" Failed" & vbCrLf & _
vbTab & "Error: " & lErr & vbCrLf & _
vbTab & "Source: " & sSource & vbCrLf & _
vbTab & "Description: " & sDesc & vbCrLf & vbCrLf
Else
sMessage = sMessage & "Step """ & oStep.name & _
""" Succeeded" & vbCrLf & vbCrLf
End If
Next
oPKG.UnInitialize
Set oStep = Nothing
Set oPKG = Nothing
MsgBox sMessage