ADO Object Command and the method CreateParameter to add a variant in a Visual FoxPro database 
Author Message
 ADO Object Command and the method CreateParameter to add a variant in a Visual FoxPro database

I would like to add a variant object in a table of a Visual FoxPro database
by using the method Execute of the ADO object command.

The type of the field in the table is:  Memo (binary)

I need do create a parameter with the method CreateParameter.

My code is :

  spParameter = spCommand->CreateParameter( "RAWDATA", ADODB::adVariant,
ADODB::adParamInput, sizeof(m_vRawData), m_vRawData );
  spCommand->Parameters->Append( spParameter );

This code generates the following error :

{"At least one parameter contained a type that was not supported." (1)}

What have I done wrong ?

Thank you.



Sun, 10 Jun 2001 03:00:00 GMT  
 ADO Object Command and the method CreateParameter to add a variant in a Visual FoxPro database
I think i've forgotten some code :

  csSQL = _T("INSERT INTO INFORMATION_ELEMENT (RAWDATATYPE) ");
  csSQL = csSQL + _T("VALUES (?)");
  spCommand->CommandText = _bstr_t(csSQL);
  spCommand->CommandType = ADODB::adCmdText;
  spCommand->Prepared = true;
  spParameter = spCommand->CreateParameter( "RAWDATA", ADODB::adVariant,
ADODB::adParamInput, sizeof(m_vRawData), m_vRawData );
  spCommand->Parameters->Append( spParameter );

  spCommand->Execute( NULL, NULL, -1);



Sun, 10 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Method takes ADO Command object as input.

2. get_item ADO method and variant_t vs VARIANT

3. How to call object methods passed as VARIANT argument

4. Variant arguments in methods of automation objects raise an exception

5. Variant arguments in methods of automation objects raise an exception

6. How to call object methods passed as VARIANT argument

7. How to call object methods passed as VARIANT argument

8. ADO Command->Execute Method

9. ADO Connection object and OpenSchema() method

10. Execute method in a connection object in ADO

11. Need help with Execute method of Command object

12. Usage of ADO Command objects for Stored procedures

 

 
Powered by phpBB® Forum Software