title: How Pass ADODB Connection object from VB Components to C# with asp.net application
body: <p>I am executing multiple vb6 components that accesses different database engines such as access (mdb), sql server, etc from within asp.net.</p>
  
  <p>These components are already compiled dlls in vb6 and added as referenced assembly in asp.net framework 2.0. Each component has several functions that passes the adodb.connection object as parameter and executes sql statements from within these functions.  This is comparable to a layered solution pattern, only, in the business logic layer they pass the adodb.connection object instead of the connection string. This works in VB6 but when called in asp.net it won't work because when the compiler encounters the adodb.connection.open() it modifies the value of the adodb.connection.connectionstring property. </p>
  
  <p>How I get connection string from adodb.connection object</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here's the <code>getConnstringfromASP</code> from comments.</p>
  
  <pre><code>public void getConnstringfromASP(ADODB.Connection getadoObjConn)
  {
      string strAdoobjConnString = ""; 
      strAdoobjConnString = getadoObjConn.ConnectionString; 
      SqlConnection objConnection = new SqlConnection(); 
      objConnection.ConnectionString = strAdoobjConnString;
  }
  </code></pre>