title: Does a connection instance need to be created in ObjectContext?
body: <p>We have old VB6 code in our production system that everyone is afraid to touch. But, occasionally, a bug is large enough that someone needs to fix it. We are in the process of rewriting the system, but in the meantime, we still have customers using the existing VB6 code.</p>
  <p>My biggest issue right now is my lack of understanding about ObjectContext. I've been reading documentation about it, and the more I read, the less I understand. I see code where sometimes, we have a block that looks like this:</p>
  <pre><code>Set CtxObject = GetObjectContext
  
  If Not CtxObject Is Nothing Then
      Set objSomeObject = CtxObject.CreateInstance(&quot;SomePackage.SomeObject&quot;)
  Else
      Set objSomeObject = CreateObject(&quot;SomePackage.SomeObject&quot;)
  End If
  </code></pre>
  <p>but, ADODB.Connection objects are never created like this. Should connection objects be created like this? If the objContext is aborted, will any updates through that connection be rolled back? Or not since they were not created within the same object context?</p>
  <p>Example of how we do create connection objects:</p>
  <pre><code>Dim oConn As New ADODB.Connection
  Dim oRS As New ADODB.RecordSet
  On Error GoTo ErrorHandler
  Dim CtxObject As ObjectContext
  Set CtxObject = GetObjectContext
  
  oConn.Open *ConnectionString*
  oRS.Open *SQL*, oConn, adOpenKeyset, adLockBatchOptimistic
  
  ...
  </code></pre>
  <p>Here, the connection object is created before the object context is grabbed, so I don't see how the connection is tied to that. If the RecordSet is updated, and then the ObjectContext is aborted, will the RecordSet updates be rolled back?</p>