IMAGE ADO Visual C++ 
Author Message
 IMAGE ADO Visual C++

I have some binary data in a CMemFile and I have a Stored Procedure that
receives an image parameter...I dont want to use getChunk/AppenChunk

I would like to knoe how can I get the binary data from CMemFile a send
it through a stored procedure to SQL server 7.0.
I've tryed somethink like :

TO READ THE BINARY DATA :

SAFEARRAY FAR* psa;            
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;    
rgsabound[0].cElements = _my_file_len;

    // create a single dimensional byte array
psa = SafeArrayCreate(VT_I1, 1, rgsabound);

memcpy( psa, _my_file.Detach(), _my_file_len );

varChunk.vt = VT_ARRAY | VT_UI1;
        varChunk.parray = psa;

...

and to try tyo send it to sql server :

TESTHR(pPrm_inode.CreateInstance(__uuidof(ADODB::Parameter)));
                pPrm_inode->Name = "inode";
                pPrm_inode->Direction = ADODB::adParamInput;
                pPrm_inode->Type = ADODB::adLongVarBinary;
                //pPrm_inode->Size = 100;
pPrm_inode->Value = *inode; // _variant_t !!

                pCmdInsertINode->Parameters->Append( pPrmReturnValue );
                pCmdInsertINode->Parameters->Append( pPrm_oid );
                pCmdInsertINode->Parameters->Append( pPrm_obj_name );
                pCmdInsertINode->Parameters->Append( pPrm_class_name );
                pCmdInsertINode->Parameters->Append( pPrm_inode );

                rsResult = pCmdInsertINode->Execute( NULL, NULL,
ADODB::adCmdStoredProc );

this code always give me an access violation in "
pPrm_inode->Value = *inode; // _variant_t !!
"

why ?

I cant find any code to get code from CMemFile and save it in the
database through Stored Procedure!

Jos Cruz



Sun, 09 Mar 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Using image ActiveX in Visual C++

2. Global Lab Image API- Visual C++ linking problem

3. change the image of toolbar botton(GUI in visual c++ 6)

4. Global Lab Image API- Visual C++ linking problem

5. How to read in and show out the image by Visual C++

6. Global Lab Image API- Visual C++ linking problem

7. Displaying images using Visual C++ 5.0

8. Visual c++ images

9. Visual C++ Image Display

10. How to bind ADO data bound controls in Visual C++

11. ADO and Visual C++

12. Using ADO from Visual C++

 

 
Powered by phpBB® Forum Software