August 14, 2006 at 8:04 pm
Hi,
I am currently doing a program in VB6 that will run a dts package. I have this code below testing in my local sql and it is working fine. But when I try connecting to other server by simply changing the server name, the dts package did not execute. Please help how to code running dts package in other server because I will deploy this to several users. Thanks so much in advance.
Dim oPkg As DTS.Package, oStep As DTS.Step
Set oPkg = New DTS.Package
Dim strUsername As String, strPassword As String
Dim strPkg As String, strServer As String
strServer = "localhost"
strUsername = "fduser"
strPassword = "fduser"
strPkg = "dtstmpFDimp"
oPkg.LoadFromSQLServer strServer, strUsername, strPassword, _
DTSSQLStgFlag_UseTrustedConnection, , , , strPkg
oPkg.Execute
oPkg.UnInitialize
Set oPkg = Nothing
August 15, 2006 at 12:03 am
Hi.. I already figure out what went wrong. My code is fine but I just got a problem with the source of my dts package. It is already resolved.
But my problem now is sometimes, in the oPkg.excute part, my program turns to not responding. Maybe I thnik its the connection.
Is there anyway I can handle this? Thanks in advance.
August 18, 2006 at 10:47 am
I assume the package will execute fine when done manually. Maybe you already doing this, but you may want to loop through each step of the package and return a result status. See if this reveals anything.
For Each oStep in oPkg.Steps
If oStep.ExecutionResult = DTSStepExecResult_Failure Then
sRetMsg = sRetMsg & oPkg.Tasks(oStep.TaskName).Description
End If
Next
I am calling this code from memory, so please pardon the syntax, but you get the idea.
Jon
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply