ADO Command->Execute throws exception
-
Using Access 2000 and ADO VC++6.0 I am executing the following statement.. VARIANT Params[2]; Params[0].vt = VT_I2; Params[0].iVal = 1; Params[1].vt = VT_R4; Params[1].fltVal = 8.99; m_pCommand->adCmdText = "Query4"; m_pCommand->ActiveConnection = m_pConnection; m_pCommand->Execute(0, Params, adCmdStoredProc); Generates an exception {DB_E_PARAMNOTOPTIONAL} Query4 in Access is as follows: PARAMETERS vID Short, Rad IEEESingle; INSERT INTO TABLE1 ( ODID, MeasRadius ) VALUES (vID, Rad); Thanks for your help in advance.
-
Using Access 2000 and ADO VC++6.0 I am executing the following statement.. VARIANT Params[2]; Params[0].vt = VT_I2; Params[0].iVal = 1; Params[1].vt = VT_R4; Params[1].fltVal = 8.99; m_pCommand->adCmdText = "Query4"; m_pCommand->ActiveConnection = m_pConnection; m_pCommand->Execute(0, Params, adCmdStoredProc); Generates an exception {DB_E_PARAMNOTOPTIONAL} Query4 in Access is as follows: PARAMETERS vID Short, Rad IEEESingle; INSERT INTO TABLE1 ( ODID, MeasRadius ) VALUES (vID, Rad); Thanks for your help in advance.
You need to inform the type of Param, if input or output, for example... But I see that you are passing a float param,, in that case you MUST to inform the presicion and the scale Regards Carlos Antollini. Sonork ID 100.10529 cantollini
-
You need to inform the type of Param, if input or output, for example... But I see that you are passing a float param,, in that case you MUST to inform the presicion and the scale Regards Carlos Antollini. Sonork ID 100.10529 cantollini
-
I saw that you are using a variant to inform the parameters, but if you use use a Parameter type you must to do the following...
pParameter->Direction = (ParameterDirectionEnum)nDirection;
pParameter->PutPrecision(nPrecision);
pParameter->PutNumericScale(nScale);Remember: When you are using a parameter type float, double, decimal, you must to inform the presisicion and the scale... Regards Carlos Antollini. Sonork ID 100.10529 cantollini