all groups > sql server dts > september 2005 >
You're in the

sql server dts

group:

How Do You Explicitly Close a DTS Connection in VB.NET?


How Do You Explicitly Close a DTS Connection in VB.NET? Anonymous
9/27/2005 5:04:04 PM
sql server dts:
In my scenario, I have a VB.NET class that runs a DTS package. This
code has worked for years, but under heavy stress I am seemingly
running out of connections from the connection pool. This leads me to
believe that the connections being used by the DTS package are not
being freed up properly after a package has executed.

I know in ADO.NET, you must explicitly Close or Dispose the connection
in the Finally portion of a Try...Catch block. So, I am trying to
determine how to do the same thing with a DTS connection and how.

Consider the following abbreviated code:
-------------------------------------------

Dim objConnection As DTS.Connection2

Try

'...Initialize the package...

'Create package connection information
objConnection = objPackage.Connections.New("SQLOLEDB")
'...Configure the SQL connection...
objPackage.Connections.Add(objConnection)
objConnection = Nothing

objConnection =
objPackage.Connections.New("Microsoft.Jet.OLEDB.4.0")
'...Configure the Access connection
objPackage.Connections.Add(objConnection)
objConnection = Nothing

'...Construct and run the package steps...

Catch ex As Exception

'...Error handling code...

Finally

'...WHAT GOES HERE TO CLOSE THE CONNECTIONS AND PACKAGE?

End Try
Re: How Do You Explicitly Close a DTS Connection in VB.NET? Allan Mitchell
9/28/2005 12:00:00 AM
On the task in its workflow properties there is a property called "close
connection on completion" Maybe this will help you.

Allan

[quoted text, click to view]
AddThis Social Bookmark Button