Issue while passing variant safearray to ADO recordset
-
vntFieldValue.vt =VT_VARIANT | VT_ARRAY;; SAFEARRAY* psaOut; psaOut =Segment->GetBlob(); // C# API return the byte() in the form of safearray if(psaOut != 0) { SAFEARRAYBOUND aDim[1]; aDim[0].lLbound= 0; aDim[0].cElements= psaOut->rgsabound->cElements;; vntFieldValue.parray=SafeArrayCreate(VT_VARIANT,1,aDim); SafeArrayCopyData(psaOut,vntFieldValue.parray); } pADORecset->Fields->GetItem(FLD_WBTRBSEG_SEGMENT)->PutValue(vntFieldValue); The line in bold color throws an exception. Could you please help me in passing the variant safearraay to set the value for recorset parameter.
-
vntFieldValue.vt =VT_VARIANT | VT_ARRAY;; SAFEARRAY* psaOut; psaOut =Segment->GetBlob(); // C# API return the byte() in the form of safearray if(psaOut != 0) { SAFEARRAYBOUND aDim[1]; aDim[0].lLbound= 0; aDim[0].cElements= psaOut->rgsabound->cElements;; vntFieldValue.parray=SafeArrayCreate(VT_VARIANT,1,aDim); SafeArrayCopyData(psaOut,vntFieldValue.parray); } pADORecset->Fields->GetItem(FLD_WBTRBSEG_SEGMENT)->PutValue(vntFieldValue); The line in bold color throws an exception. Could you please help me in passing the variant safearraay to set the value for recorset parameter.
Have seen sample for using safearrays ? There are quite a few on this site itself. The bold line is having quite a few function calls, try to break it, and narrow down on function , throwing exception.