InteropServices.COMException

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

I'm in the middle of converting an old vb6 app to dot net and I'm having a
problem with running a DTS package. I keep getting this runtime error and
I'm sure why or how to fix.

Run-time exception thrown : System.Runtime.InteropServices.COMException -
Type mismatch.

Here's my code snippet:

objPKG = CreateObject("DTS.Package")

objPKG.LoadFromSQLServer("TEST", "sa", "test1234", 0, "", "", "",
strPackageName)

For Each oStep In objPKG.Steps

If oStep.ExecutionResult = 1 Then

oStep.ExecuteInMainThread = True

MsgBox(CStr(objPKG.Tasks(oStep.TaskName).Description))

End If

Next oStep
 
msnews.microsoft.com said:
I'm in the middle of converting an old vb6 app to dot net and I'm having a
problem with running a DTS package. I keep getting this runtime error and
I'm sure why or how to fix.

Run-time exception thrown : System.Runtime.InteropServices.COMException -
Type mismatch.

Here's my code snippet:

objPKG = CreateObject("DTS.Package")

objPKG.LoadFromSQLServer("TEST", "sa", "test1234", 0, "", "", "",
strPackageName)

For Each oStep In objPKG.Steps

If oStep.ExecutionResult = 1 Then

oStep.ExecuteInMainThread = True

MsgBox(CStr(objPKG.Tasks(oStep.TaskName).Description))

End If

Next oStep

Hi Brian,

What version of .Net Framework do you use?

Also, I don't see any code for destroying the object after instansiating and use?!


Adel A. Al-saleh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top