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. ADO - UPDATE -newbie

ADO - UPDATE -newbie

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestionannouncement
3 Posts 3 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.
  • A Offline
    A Offline
    antonaras
    wrote on last edited by
    #1

    Hi again i wrote this function to update a record in access using ADO but i get an error can anyone find out whats wrong int valField5; int valField2; double valField4; string command; _bstr_t strtest=valField4; pCommand->ActiveConnection = m_pConn;//previously opened connection command="UPDATE tblDictionary SET Spam="+valField2; command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error command+=",app="+valField5; command+=" WHERE token='"+ token; command+="'"; _bstr_t strSQLstatment=command.c_str(); variant_t vntRecordAffected; m_pConn->Execute(strSQLstatment,&vntRecordAffected,adCmdText); It compiles ok but then i get an error Error:Θï█ Press any key to continue i know my question is not very clear but if u can see anything that might cause the error pls let me know. is it because i'm not giving the values for all columns of the record in the database table i have token text Spam number Ham number Pos number(with decimal) app number i only try to update some values is that correct thanks again

    E D 2 Replies Last reply
    0
    • A antonaras

      Hi again i wrote this function to update a record in access using ADO but i get an error can anyone find out whats wrong int valField5; int valField2; double valField4; string command; _bstr_t strtest=valField4; pCommand->ActiveConnection = m_pConn;//previously opened connection command="UPDATE tblDictionary SET Spam="+valField2; command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error command+=",app="+valField5; command+=" WHERE token='"+ token; command+="'"; _bstr_t strSQLstatment=command.c_str(); variant_t vntRecordAffected; m_pConn->Execute(strSQLstatment,&vntRecordAffected,adCmdText); It compiles ok but then i get an error Error:Θï█ Press any key to continue i know my question is not very clear but if u can see anything that might cause the error pls let me know. is it because i'm not giving the values for all columns of the record in the database table i have token text Spam number Ham number Pos number(with decimal) app number i only try to update some values is that correct thanks again

      E Offline
      E Offline
      Eytukan
      wrote on last edited by
      #2

      Please Display! the error properly.


      --[V]-- [My Current Status] -- modified at 7:25 Monday 5th June, 2006

      1 Reply Last reply
      0
      • A antonaras

        Hi again i wrote this function to update a record in access using ADO but i get an error can anyone find out whats wrong int valField5; int valField2; double valField4; string command; _bstr_t strtest=valField4; pCommand->ActiveConnection = m_pConn;//previously opened connection command="UPDATE tblDictionary SET Spam="+valField2; command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error command+=",app="+valField5; command+=" WHERE token='"+ token; command+="'"; _bstr_t strSQLstatment=command.c_str(); variant_t vntRecordAffected; m_pConn->Execute(strSQLstatment,&vntRecordAffected,adCmdText); It compiles ok but then i get an error Error:Θï█ Press any key to continue i know my question is not very clear but if u can see anything that might cause the error pls let me know. is it because i'm not giving the values for all columns of the record in the database table i have token text Spam number Ham number Pos number(with decimal) app number i only try to update some values is that correct thanks again

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

        antonaras wrote:

        command+=",Pos="+strtest;//when i write pos="valField4; i get compilation error

        Have you tried:

        command += ",Pos=";
        command += valField4;


        "The largest fire starts but with the smallest spark." - David Crow

        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