?
Solved

ADO Recordset error when appending fields

Posted on 2010-09-08
1
Medium Priority
?
1,951 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Make the most of your online learning experience.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

771 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