I found the solution... it's the GetChunck method.... if(pRecordset != NULL) { while (!pRecordset->GetEndOfFile()) { ADO_LONGPTR size = pRecordset->Fields->Item["test"]->ActualSize; BYTE* buffer = new BYTE[size]; _variant_t varChunk; varChunk = pRecordset->Fields->Item["test"]->GetChunk(size); BYTE * pData = NULL; SafeArrayAccessData(varChunk.parray, (void HUGEP* FAR*)&pData); memcpy(buffer, pData, size); SafeArrayUnaccessData(varChunk.parray); ofstream myFile ("C:\\Blue hills.jpg", ios::out | ios::binary); myFile.write((char*)buffer, size); myFile.flush(); pRecordset->MoveNext(); } pRecordset->Close(); }
Eusebiu