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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Different versions of ODBC drivers accept different parameters (Execute())??

Different versions of ODBC drivers accept different parameters (Execute())??

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

    in my app, i have the following code run successfully with MS Access Driver 4.00.6019.00, but fail with version 4.00.6200.00. the exception thrown says "[ODBC MS Access Driver] Too few parameters. Expected 1." // _ConnectionPtr m_pConnection; // _RecordsetPtr m_pRecordSet; m_pRecordSet = m_pConnection->Execute(_bstr_t(query), &vRecsAffected, adOptionUnspecified); How should i overcome this problem? is there a generic way that works with different versions of MS Access Driver? Thanks a lot! Wenrich

    P 1 Reply Last reply
    0
    • W Wenrich

      in my app, i have the following code run successfully with MS Access Driver 4.00.6019.00, but fail with version 4.00.6200.00. the exception thrown says "[ODBC MS Access Driver] Too few parameters. Expected 1." // _ConnectionPtr m_pConnection; // _RecordsetPtr m_pRecordSet; m_pRecordSet = m_pConnection->Execute(_bstr_t(query), &vRecsAffected, adOptionUnspecified); How should i overcome this problem? is there a generic way that works with different versions of MS Access Driver? Thanks a lot! Wenrich

      P Offline
      P Offline
      Pavel Klocek
      wrote on last edited by
      #2

      What is in query? Maybe some field name is equal to a reserved word added in new version? Pavel Sonork 100.15206

      W 1 Reply Last reply
      0
      • P Pavel Klocek

        What is in query? Maybe some field name is equal to a reserved word added in new version? Pavel Sonork 100.15206

        W Offline
        W Offline
        Wenrich
        wrote on last edited by
        #3

        Thanks Varel! this query is CString query; query.Format(_T("SELECT * FROM %s WHERE (%s='%s') AND (%s='%s')"), table, key, value1, field, value2); // table:"client", key:"ID", value1:"some name", field:"Pass", values"some // password" Is there anything wrong with the field names? Thanks a lot!

        P 1 Reply Last reply
        0
        • W Wenrich

          Thanks Varel! this query is CString query; query.Format(_T("SELECT * FROM %s WHERE (%s='%s') AND (%s='%s')"), table, key, value1, field, value2); // table:"client", key:"ID", value1:"some name", field:"Pass", values"some // password" Is there anything wrong with the field names? Thanks a lot!

          P Offline
          P Offline
          Pavel Klocek
          wrote on last edited by
          #4

          I would try:

          SELECT * FROM [%s] WHERE ([%s]='%s') AND ([%s]='%s')

          Doesn't some of the values contain an ' character (apostrof)? Pavel Sonork 100.15206

          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