Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 373081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:16:25+00:00 2026-05-12T14:16:25+00:00

I have a native C++ DLL that uses COM ADO Recordsets and am in

  • 0

I have a native C++ DLL that uses COM ADO Recordsets and am in need of converting it to the .NET variant (ADODB::Recordset). I have tried several approaches to tackling this problem without success.
The native C++ DLL dynamically creates and populates the COM Recordset. Ideally I’d do the same for the ADODB::Recordset within the managed wrapper, but the needed properties aren’t accessible to me.
For example, when attempting to utilize the Fields collection in order to Append Columns (despite intellisense telling me otherwise), I receive:

error C2039: ‘Fields’ : is not a member of ‘ADODB::Recordset’

ADODB::Recordset ^RS = gcnew ADODB::Recordset ();
RS->Fields->Append("ID", DataTypeEnum::adInteger, 1, FieldAttributeEnum::adFldKeyColumn);

My C++/CLI solution contains the ADODB reference (c:\Program Files\Microsoft.NET\Primary Interop Assemblies\adodb.dll) version 7.0.3300.0
I am using Visual Studio 2005 with .NET Framework 2.0.50727 SP2

I would appreaciate it if someone in the StackOverflow community can direct me to a sample that dynamically populates a .NET ADO Recordset using C++/CLI.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:16:25+00:00Added an answer on May 12, 2026 at 2:16 pm

    I think that the main difference between the raw COM Recordset and the one provided by the .Net wrapper classes is just that some things get renamed. It is simply a wrapper around the underlying COM object and not a new class in its own right.

    To answer your immediate example, try

    RS->default->Append(...);
    

    You could try to run ILDASM over the adodb.dll you have to see what the API on the recordset class is.

    You can do the following too:

    //Create instance of a recordset
    ADODB::RecordsetClass^ recordset;
    recordset = gcnew ADODB::RecordsetClass();
    
    //Set some options
    recordset->CursorLocation = ADODB::CursorLocationEnum::adUseClient ;
    recordset->CursorType = ADODB::CursorTypeEnum::adOpenDynamic;
    recordset->LockType = ADODB::LockTypeEnum::adLockBatchOptimistic;
    
    //Add columns
    recordset->default->Append("Name", ADODB::DataTypeEnum::adWChar, 50, ADODB::FieldAttributeEnum::adFldFixed, nullptr);
    recordset->default->Append("Number", ADODB::DataTypeEnum::adWChar, 20, ADODB::FieldAttributeEnum::adFldFixed, nullptr);
    
    //Build an array of field names
    fields = gcnew array<Object^>(2);
    fields[0] = gcnew String("Name");
    fields[1] = gcnew String("Number");
    
    //Add values
    array<Object^>^ values = gcnew array<Object^>(2);
    values [0] = "some name";
    values [1] = 1.2;
    recordset->AddNew(fields, values);
    
    //Get a value out again
    recordset->MoveFirst();
    ADODB::Field^ pNum= recordset->default[1];
    double num = Convert::ToDouble((pNum->default));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 32-bit .net application that uses a native 32-bit DLL via DllImport().
I have a native VC++ project that uses a dll (which is not in
I have a c# .net 2.0 CF application that interfaces with a native DLL
I have a .NET application that makes calls to a native Win32 DLL using
I have a managed dll that calls into a native library. This native library
I have some applications (some native, some .NET) which use manifest files so that
I have code that uses methods from the SSPI dll (security.dll) via P/Invoke, which
I have a C++/CLI assembly that wraps a native 32-bit dll. The assembly is
I have a function in a native DLL defined as follows: #include <string> void
I know that PHP doesn't yet have native Enumerations. But I have become accustomed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.