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. Edit a record in a DB table opened with ODBC

Edit a record in a DB table opened with ODBC

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabaseannouncement
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.
  • S Offline
    S Offline
    sirtimid
    wrote on last edited by
    #1

    Itr to edit a record of a table which it has fields of type float. When these fields have decimals the update cannot be done. But when they are without decimals the update is successful. Does anyone know how can I update the record even if it has fields with decimals? Thanks in Advance

    D 1 Reply Last reply
    0
    • S sirtimid

      Itr to edit a record of a table which it has fields of type float. When these fields have decimals the update cannot be done. But when they are without decimals the update is successful. Does anyone know how can I update the record even if it has fields with decimals? Thanks in Advance

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

      Without seeing a relevant code snippet, it's hard to say what you are doing wrong.


      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

      S 1 Reply Last reply
      0
      • D David Crow

        Without seeing a relevant code snippet, it's hard to say what you are doing wrong.


        "One must learn from the bite of the fire to leave it alone." - Native American Proverb

        S Offline
        S Offline
        sirtimid
        wrote on last edited by
        #3

        double value=15.1 TableSet->Open(); TableSet->MoveFirst(); while(!TableSet->IsEOF()) { if(TableSet->m_field1 == id) { TableSet->Edit(); TableSet->m_field2 += value; TableSet->Update(); } else { TableSet->MoveNext(); } } When TableSet->m_field2, which is of type float, has decimals the update return error. When it does not have decimals no error occurs. Any idea?

        D 1 Reply Last reply
        0
        • S sirtimid

          double value=15.1 TableSet->Open(); TableSet->MoveFirst(); while(!TableSet->IsEOF()) { if(TableSet->m_field1 == id) { TableSet->Edit(); TableSet->m_field2 += value; TableSet->Update(); } else { TableSet->MoveNext(); } } When TableSet->m_field2, which is of type float, has decimals the update return error. When it does not have decimals no error occurs. Any idea?

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

          sirtimid wrote: ...the update return error. And what would that error be? What does the DoFieldExchange() method look like for the CRecordset-derived class? Is the corresponding field in the database table a floating-point type?


          "One must learn from the bite of the fire to leave it alone." - Native American Proverb

          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