title: SQLBindParameter and SQLExecute returns SQL_NEED_DATA
body: <p>I'm working on a C application that interacts with a mssql database running on Windows 2008 R2. I'm able to connect to the database and run specific queries, but when i use SQLBindParameter things fall apart.</p>
  
  <p>I found a post on stackoverflow that appears to be the same problem, but the solution doesnt appear to be the same (<a href="https://stackoverflow.com/questions/11945701/problems-getting-sqlbindparameter-to-work-in-c">Problems getting SQLBindParameter to work in C++</a>). According to C Data types SQL_C_CHAR is correct (<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms714556(v=vs.85).aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/windows/desktop/ms714556(v=vs.85).aspx</a>)</p>
  
  <p>Here is the code</p>
  
  <pre><code>    SQLINTEGER strlentemp = SQL_NTS;
      SQLCHAR *sqlstmt = "select * from detail where name = ?";
      status = SQLPrepare(hstmt-&gt;hstmt, sqlstmt, SQL_NTS);
      unsigned char *temp = "myvalue";
      status = SQLBindParameter(hstmt-&gt;hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 50,0,temp,strlen(temp),&amp;strlentemp);
      status = SQLExecute(hstmt-&gt;hstmt);
  </code></pre>
  
  <p>SQLExecute will return 99, SQL_NEED_DATA. If i call SQLParamData after SQLExecute it also returns 99 and the ValuePtrPtr (the 2nd argument) is the data i've passed through (temp).</p>
  
  <p>Any thoughts? What am i missing? </p>