Re: How to put array Value in C++

From: Jerry Pisk (jerryiii_at_hotmail.com)
Date: 05/23/04


Date: Sun, 23 May 2004 01:45:30 -0700

Don't you have to call SafeArrayUnaccessData when you're done with copying
your data into the buffer?

Jerry

"Tim" <anonymous@discussions.microsoft.com> wrote in message
news:94929D9E-7453-4ADD-92D7-A3BA784227DF@microsoft.com...
> SAFEARRAY *psa;
> How to put an array value into recordset Value property? What's wrong with
this code?
>
> LPSTR HUGEP *psb;
> VARIANT v;
> VariantInit(&v);
> psa=SafeArrayCreateVector(VT_UI1,0,400);
> SafeArrayAccessData(psa,(void HUGEP**)&psb);
> memcpy((LPSTR)psb,fv,400);
> v.vt=VT_ARRAY|VT_UI1;
> v.parray=psa;
> pRS->Fields->GetItem("DATA")->put_Value(v);
>
> also tried
>
> pRS->Fields->GetItem("DATA")->appendChunk(v);
>
> Both failed.
>
> Thanks.
>



Relevant Pages

  • RE: Error 3021
    ... The only thing I see is that after you open the recordset, ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to make fetching and displaying of data from dtabase to workbo
    ... It actually imports at lightning speed ... ... I need to get data from the database and display in the excel sheet. ... Make a temporary array and while moving through the Recordset data ...
    (microsoft.public.excel.programming)
  • Re: Sorting VBScript Array
    ... I would like to have the option to sort ... Michael Harris containing the word recordset. ... 'This sample code sets up a 3 by 5 array, adds data to it, ... Dim sMsg ...
    (microsoft.public.scripting.vbscript)
  • Re: Problems check Array object status when using .GetRows
    ... How do I zap the local var/array before doing my routine? ... Erase local var/array cos it might not be an array and therefore a tyoe ... > recordset data and seems to work fine. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Recordset or Array?
    ... I'd be interested in seeing the scripts. ... that GetRows returns an array of variants. ... Just because the client side recordset loads and stores all the data at once ...
    (microsoft.public.inetserver.asp.db)