When do SQLExecut() return SQL_NO_DATA_FOUND for a SELECT statement? (ODBC)
863624Aug 25 2011 — edited Aug 26 2011Question:
When do SQLExecute() return SQL_NO_DATA_FOUND for a SELECT statement?
Senario:
Following is related ODBC API call thread in our product:
SQLBindCol()
SQLPrepare("select col from test_table where col = ?")
SQLBindParameter()
SQLExecute() --->> It returns SQL_NO_DATA_FOUND
Analysis
Based on the introduction of SQLExecute() at http://msdn.microsoft.com/zh-cn/library/ms713584%28v=VS.85%29.aspx, SQLExecute() will return SQL_NO_DATA ONLY when executing a searched update, insert, or delete statement that does not affect any rows at the data source. However, in my case, I'm executing a SELECT statement, but SQLExecute() returns SQL_NO_DATA.
Can anyone tell me when do SQLExecute() return SQL_NO_DATA_FOUND for a SELECT statement?
Thanks in advance!