[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ADO Recordset error when appending fields

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Loops Section Overview

872 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