English

How To: Terminating an SDE connection

Procedure

Important step to follow before terminating an SDE connection.

Solution:

Before terminating an SDE connection, it is important to make sure any map layers referencing the connection are also removed and set equal to Nothing:

Code:
Set my_SDE_Layer = Map1.Layers(layer_id)
Map1.Layers.Remove layer_id
Set my_SDE_Layer = Nothing
dc.Disconnect

Note:
The DataConnection.Connected property may return False even though the DataConnection has not successfully disconnected.