i got this error when i program in vb using DTS. on my computer it runs
fine with error but when i install on my clients' pc , it comes out with
this error->"can't create activex component runtime error". pls advise.
If yearStr <> Trim(cmbYear.Text) Then
infomsg = MsgBox("Year selected does not match year_code in Budget
File uploaded!", vbCritical, "Incorrect File Used")
Screen.MousePointer = vbDefault
Exit Sub
End If
SimpleExecutePackage
----------------------------
Private Sub SimpleExecutePackage()
Dim sMessage As String
Dim lErr As Long
Dim sSource As String
Dim sDesc As String
Set oPKG = New DTS.Package
oPKG.LoadFromSQLServer "TBSSDB", "sa", "", DTSSQLStgFlag_Default, , , ,
"Upload TBSS Budget"
oPKG.GlobalVariables("sFileName").Value = Trim(txtFileName.Text)
oPKG.GlobalVariables("sTableName").Value = Trim(xlsString)
oPKG.GlobalVariables("sHeaderName").Value = Trim(HeaderString)
oPKG.SaveToSQLServer "TBSSDB", "sa", "", DTSSQLStgFlag_Default, , , , ,
True
For Each oStep In oPKG.Steps
oStep.ExecuteInMainThread = True
Next
oPKG.Execute
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
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!