title: Strange error appending fields to recordset in VS2010 after converting to .NET 4
body: <p>I have some code from this site <a href="http://www.codeproject.com/KB/database/DataTableToRecordset.aspx" rel="nofollow">CodeProjectLink</a> to convert a datatable to a recordset. This code had been working fine until I changed to .NET 4 (was previously 2), now when I call the following line:</p>
  
  <pre><code>Dim result As New ADODB.Recordset()
  result.CursorLocation = ADODB.CursorLocationEnum.adUseClient
  
  Dim resultFields As ADODB.Fields = result.Fields
  Dim inColumns As System.Data.DataColumnCollection = inTable.Columns
  
      For Each inColumn As DataColumn In inColumns
          ' The next line gives the error
          resultFields.Append(
              inColumn.ColumnName, 
              TranslateType(inColumn.DataType), 
              inColumn.MaxLength, 
              IIf(inColumn.AllowDBNull, 
                  ADODB.FieldAttributeEnum.adFldIsNullable, 
                  ADODB.FieldAttributeEnum.adFldUnspecified), 
              Nothing)
  
      Next
  </code></pre>
  
  <p>I get this strange error:</p>
  
  <p><strong>Error: Missing method 'instance void MYDLLNAME ADODB.Fields::Append(string,valuetype ADODB.DataTypeEnum,int32,valuetype ADODB.FieldAttributeEnum,object)' from class 'ADODB.InternalFields'.</strong></p>
  
  <p>I tried changing my line to just: </p>
  
  <pre><code>resultFields.Append(inColumn.ColumnName, TranslateType(inColumn.DataType)) 
  </code></pre>
  
  <p>but this gave the same error. The TranslateType function is correctly returning ADODB.DataTypeEnum.adVarChar so this seems valid as well </p>