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