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. C / C++ / MFC
  4. Populating Array Difficulty

Populating Array Difficulty

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databasedata-structuresquestion
4 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
    Mike Certini
    wrote on last edited by
    #1

    I have built a program utilizing ADO to pull data from an Access Database. I am having problems taking this data which is formated as a _variant_t data type to a floating point array in C++. The following is the initial format of the array and the process that is attempting to populate this array. Can someone help me with a good source to learn about these conversions? Secondly, can someone help me with the proper code for the array so that it can be populated? At the bottom is the error message I am getting. const int arraySize = 5000; _variant_t OpenArr[arraySize]; ADODB::_RecordsetPtr recOpen = NULL; while(!recOpen->EOFile) { record++; Open = pOpenField->Value; Open.ChangeType(VT_R4); printf("Data_Open: %4.5f\n", Open.fltVal); printf("Record: %d\n", record); OpenArr[record]=recOpen->GetRows(-1,0); recOpen->MoveNext( ); } Data_Open: 1.41283 Record: 1 Error Code = 800a0d5d Code meaning = U Source = ADODB.Recordset Description = Application uses a value of the wrong type for the current operation.

    D 1 Reply Last reply
    0
    • M Mike Certini

      I have built a program utilizing ADO to pull data from an Access Database. I am having problems taking this data which is formated as a _variant_t data type to a floating point array in C++. The following is the initial format of the array and the process that is attempting to populate this array. Can someone help me with a good source to learn about these conversions? Secondly, can someone help me with the proper code for the array so that it can be populated? At the bottom is the error message I am getting. const int arraySize = 5000; _variant_t OpenArr[arraySize]; ADODB::_RecordsetPtr recOpen = NULL; while(!recOpen->EOFile) { record++; Open = pOpenField->Value; Open.ChangeType(VT_R4); printf("Data_Open: %4.5f\n", Open.fltVal); printf("Record: %d\n", record); OpenArr[record]=recOpen->GetRows(-1,0); recOpen->MoveNext( ); } Data_Open: 1.41283 Record: 1 Error Code = 800a0d5d Code meaning = U Source = ADODB.Recordset Description = Application uses a value of the wrong type for the current operation.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Have you Googled for 800a0d5d?

      Mike Certini wrote:

      OpenArr[record]=recOpen->GetRows(-1,0);

      Have you tried other arguments to GetRows()? I've never used it, but -1 looks odd as the number of rows to retrieve.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Man who follows car will be exhausted." - Confucius

      M 1 Reply Last reply
      0
      • D David Crow

        Have you Googled for 800a0d5d?

        Mike Certini wrote:

        OpenArr[record]=recOpen->GetRows(-1,0);

        Have you tried other arguments to GetRows()? I've never used it, but -1 looks odd as the number of rows to retrieve.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        M Offline
        M Offline
        Mike Certini
        wrote on last edited by
        #3

        According to what I have read, this is a proper parameter. Here is a link: http://msdn.microsoft.com/en-us/library/ee266344(v=BTS.10).aspx[^]

        D 1 Reply Last reply
        0
        • M Mike Certini

          According to what I have read, this is a proper parameter. Here is a link: http://msdn.microsoft.com/en-us/library/ee266344(v=BTS.10).aspx[^]

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          My bad. I was using a slightly aged version of MSDN.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          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