question

OwenRansen-2591 avatar image
0 Votes"
OwenRansen-2591 asked OwenRansen-2591 answered

If I get a DBVT_BINARY data from a record, how long is CDBVariant::m_pbinary?

I've been asked to pick up an old project by someone who has retired or died. Part of the project is to read/write binary data from an Access database. I've got to the stage where I can recognise the binary data field....

         CDBVariant DBVariant ;
         RecSet.GetFieldValue("Valori_Fot",DBVariant) ;
         gLogger.Printf(ekLogMsg, "   has type %d", DBVariant.m_dwType) ;
         if (DBVariant.m_dwType == DBVT_BINARY)
         {
             // Get hold of the binary data

         }

but where is the length of the binary data set, or how is the end marked?






c++office-access-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

I think that it is DBVariant.m_pbinary->m_dwDataLength.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OwenRansen-2591 avatar image
0 Votes"
OwenRansen-2591 answered

@Viorel-1 I can't get at the code at the moment, but I'll try it tomorrow, thanks.

I've found something (in German which I do not speak) which also could work GetBinarySize:

https://www.xon.de/x1/x1ref/index.html?html__mfc_cdbvariant_m_pbinary.htm



I'll try both and get back to you

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.