SYMPTOMS
If you use SQLBindParameter to directly pass more than 32K of data to a SQL
statement against 16-bit desktop database drivers, you will get the
following error message:
SQL_ERROR: Memory allocation failure.
The following is a piece of the code to duplicate the error:
//data source is an access table objtab with only one OLE field.
//16-bit Access driver 2.00.2317 is used
SQLPrepare(hstmt, "insert into objtab(?)", SQL_NTS);
BigObj = AllocateMemory(sizeof(UCHAR) * 32800);
cbBigObj = 32800;
SQLBindParameter(
hstmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_C_LONGVARCHAR,
32800, 0, BigObj, 32800, &cbBigObj);
//Prepare the BigObj
SQLExecute(hstmt);
Returns:
SQL Error State:S1001; Native Error Code: 34;
ODBC Error:[Microsoft][ODBC Microsoft Access 2.0 Driver]memory
allocation failure.
NOTE: If cbBigObj is changed to 32750 (with corresponding changes in
SQLBindParameter), SQLExecute will succeed.