Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Save a _RecordsetPtr into map

Save a _RecordsetPtr into map

Scheduled Pinned Locked Moved ATL / WTL / STL
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrKBA
    wrote on last edited by
    #1

    Hello, I have a recordset which contains a lot of data , I need to save it into map or any kind of dictionnary (which have a key and other data) I have for example :

    pRecordset->MoveFirst();
    while (!pRecordset->EndOfFile)
    {
    vIdTrans =pRecordset->Fields->Item["id_translation"]->Value;
    vCaption =pRecordset->Fields->Item["id_caption"]->Value;
    vLang =pRecordset->Fields->Item["id_language"]->Value;
    vTranslation =pRecordset->Fields->Item["translation_text"]->Value;

    strIdTrans = CUtils::GetVariantAsCString(vIdTrans);
    strCaption = CUtils::GetVariantAsCString(vCaption);
    strLang = CUtils::GetVariantAsCString(vLang);
    strTranslation = CUtils::GetVariantAsCString(vTranslation);

    // What I have here is :

    • id_translation : key of table
    • id_caption and id_language are REFERENCES from other tables.
    • translation_text : data

    So , what I need after is getting data by (id_caption and id_language) and it will be more better if (id_caption, id_language and id_translation)

    how do that ?
    }

    B 1 Reply Last reply
    0
    • M MrKBA

      Hello, I have a recordset which contains a lot of data , I need to save it into map or any kind of dictionnary (which have a key and other data) I have for example :

      pRecordset->MoveFirst();
      while (!pRecordset->EndOfFile)
      {
      vIdTrans =pRecordset->Fields->Item["id_translation"]->Value;
      vCaption =pRecordset->Fields->Item["id_caption"]->Value;
      vLang =pRecordset->Fields->Item["id_language"]->Value;
      vTranslation =pRecordset->Fields->Item["translation_text"]->Value;

      strIdTrans = CUtils::GetVariantAsCString(vIdTrans);
      strCaption = CUtils::GetVariantAsCString(vCaption);
      strLang = CUtils::GetVariantAsCString(vLang);
      strTranslation = CUtils::GetVariantAsCString(vTranslation);

      // What I have here is :

      • id_translation : key of table
      • id_caption and id_language are REFERENCES from other tables.
      • translation_text : data

      So , what I need after is getting data by (id_caption and id_language) and it will be more better if (id_caption, id_language and id_translation)

      how do that ?
      }

      B Offline
      B Offline
      barneyman
      wrote on last edited by
      #2

      I think Disconnected Recordsets[^] may be useful to you

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups