Here is what you would do to get the binary data into the _variant_t. If the database is set up to handle the binary data, it should work for you.
Note that the _variant_t will take care of doing a deep destroy on the SAFEARRAY
when it goes out of scope, so you don't have to worry about doing a SafeArrayDestroy
.
_variant_t var;
var.vt = VT_ARRAY | VT_UI1;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].cElements = 6;
rgsabound[0].lLbound = 0;
var.parray = SafeArrayCreate(VT_UI1,1,rgsabound);
void * pArrayData = NULL;
SafeArrayAccessData(var.parray,&pArrayData);
memcpy(pArrayData, mac, 6);
SafeArrayUnaccessData(var.parray);
m_pWiFiRecords->Fields->Item[varColumnIndex]->Value = var;