Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Issue while passing variant safearray to ADO recordset

Issue while passing variant safearray to ADO recordset

Scheduled Pinned Locked Moved COM
helpcsharpjson
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sivasankar anumula
    wrote on last edited by
    #1

    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.

    P 1 Reply Last reply
    0
    • S sivasankar anumula

      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.

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups