The code above contains a potential bug. In the first time through the while loop, in the statement if (SQLGetData(hStmt, 2, SQL_C_BINARY, pPicture, 0, &pIndicators[1])the pPicture variable, used as the 4th parameter, is in an uninitialized, indeterminate state. Ordinarily, this would not matter, because the 5th parameter, the so-called BufferLength parameter, is 0, and so SQLGetData should never attempt to de-reference this parameter. HOWEVER, SQLGetData requires that this parameter _N
↧