Solved

ADO Recordset error when appending fields

Posted on 2010-09-08
1
1,933 Views
Last Modified: 2012-05-10
After googling and searching EE for a solution, I finally admit that I need help from you guys (and girls).

I need to append fields to a closed Recordset. It should be easy enough:

            ADODB.Recordset rs = new ADODB.Recordset();
            rs.Fields.Append("My columne name", ADODB.DataTypeEnum.adDouble, 0, ADODB.FieldAttributeEnum.adFldIsNullable, null);

But then I get this error in the second line:
  Message=Error: Missing method 'instance void [MyClass] ADODB.Fields::Append(string,valuetype ADODB.DataTypeEnum,int32,valuetype ADODB.FieldAttributeEnum,object)' from class 'ADODB.InternalFields'.

I have checked the specifications of the Append-method, and itseems that I am using it correctly.
Still, I hope some of you might tell me what's wrong, so that I can correct my code ASAP :)

Looking forward to your replies.
0
Comment
Question by:royend
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
royend earned 0 total points
ID: 33633515
Found the solution:
I had tried the 2.8 and 6.0-version of the ADODB reference, while I had to use:
Microsoft ActiveX Data Objects 2.7 Library

My intention was to make my code more efficient by avoiding an extra for(i = 0; i < n; i++), as I had needed two loops in my original setup:
1. read data into DataList.
2. output into Excel.

I had thought that this would be quicker:
1. read data into Recordset.
2. Use newWorksheet.Range["A2"].CopyFromRecordset(Recordset);

But it turned out to be twice as slow...
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Introduction to Processes
Starting up a Project

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question