In MFC, while trying to read data from a SQL Server VARBINARY(MAX) field, the CRecordset::GetFieldValue function asserts in dbcore.cpp, at
void* PASCAL CRecordset::GetDataBuffer(CDBVariant& varValue,
short nFieldType, SQLLEN* pnLen, short nSQLType, SQLULEN nPrecision)
function, in the line
// better know the length!
ASSERT(nPrecision != 0);
*pnLen = nPrecision;
After that, it throws an "Invalid Argument Value" exception. I can't read the value.
It worked before with SQL Server's IMAGE type, but it's deprecated, so I try not to use it