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. Database & SysAdmin
  3. Database
  4. SQLBindParameter producing SQL_NEED_DATA and/or [Microsoft][ODBC Driver Manager] Program type out of range

SQLBindParameter producing SQL_NEED_DATA and/or [Microsoft][ODBC Driver Manager] Program type out of range

Scheduled Pinned Locked Moved Database
databasehelpwpfwcfquestion
1 Posts 1 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
    Member 12335695
    wrote on last edited by
    #1

    Hi All,

    We are working on a Windows desktop application and which interacts with a MS-Access as end database. We are writing some rows into tables of Ms-Access database by binding the parameters using SQLBindParameter.

    At the time of binding a double and a string separately using SQLBindParameter(), it is successful and after SQL_Execute statement getting "Program type out of range" and "SQL_NEED_DATA" error correspondingly.

    The SQLBindParameter() calls as below:

    Scenario 1 - binding double parameter:

              double pValue;
    
             SQLINTEGER iResult = 0;
    
              iRetCode = SQLBindParameter(
              this->m\_hStatement
              , 1
              , SQL\_PARAM\_INPUT
              , SQL\_C\_DOUBLE
              , SQL\_DOUBLE
              , 8
              , 5
              , (SQLPOINTER\*)pValue
              , 0
              , (SQLLEN\*)&iResult
          );
    

    and it is producing [Microsoft][ODBC Driver Manager] Program type out of range error.

    Scenario 2 - binding string parameter(Uni code character set):

              CString pValue;
             SQLINTEGER iResult = SQL\_NTS;
    
              iRetCode = SQLBindParameter(
              this->m\_hStatement
              , 1
              , SQL\_PARAM\_INPUT
              , SQL\_C\_WCHAR
              , SQL\_WCHAR
              , 32
              , 0
              , (SQLPOINTER\*)pValue
              , 32
              , (SQLLEN\*)&iResult
          );
    

    and it is producing SQL_NEED_DATA error.

    Surprisingly, when I ran the above one by using sample program it is successfully writing record into the table, but when it comes to application, its giving SQL_NEED_DATA error.

    I am trying to fix them for couple of days, but no luck. I appreciate your contribution to this question.

    Thanks in advance,

    Lakshmi NC.

    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